Skip to main content

plotting - Why do I get empty graph when adding 'Abs' function?


Can someone be so nice to provide some help for this particular situation? I try to plot a graph of a derivative which contains modulus. Without it the graph is drawn correctly:


correct graph


But when I wrap the expression in the Abs Mathematica outputs an empty graph:


empty graph


I looked for several answers related to empty graphs, but nothing seems to fit to my case. Thanks in advance.




Answer



Might it be the way Mathematica deals with the derivative of Abs[]? For example,


D[Abs[5 - 2 x], x]

returns


-2*Derivative[1][Abs][5 - 2*x]

Try


Plot[Evaluate[D[Sqrt[(5 - 2 x)^2], x]], {x, -10, 10}]

Comments