I have a complex valued ODE.
ysol = NDSolveValue[{y'[x] == I Sin[y[x] Cos[x y[x]]], y[0] == .5}, y, {x, 0, 30}];
Plot[Abs[ysol[x]], {x, 0, 30}, PlotRange -> All]
The function $\left|y(t)\right|$ is plotted below:
I want to calculate the derivative of this function i.e., $\left|y(t)\right|'$. How can that be done? I tried the following but it does not work this way.
Plot[D[Abs[ysol[x]],x], {x, 0, 30}, PlotRange -> All]




Abs[z]is not a differentiable function of the (complex) variablez. Sinceysol[x]appears to be positive, why not useD[ysol[x], x]? Alternatively, useRealAbs[..]instead ofAbs[..]. – Michael E2 Jul 12 '21 at 05:11EvaluateinPlot[Evaluate[D[...]],...]-- Alternatively, use prime:Plot[ysol'[x], {x, 0, 30},...]– Michael E2 Jul 12 '21 at 05:14Plot[Re[ysol[x] Conjugate[ysol'[x]]]/Abs[ysol[x]], {x, 0, 30}, PlotRange -> All, Exclusions -> None]– Michael E2 Jul 12 '21 at 05:57