h[x_] := Log[2 x + xSin[x]]

h'[x_] := (2 + Sin[x] + xCos[x])/(2 x + xSin[x])

Plot[{h[x], h'[x]}, {x, 0, 10}]

Whenever I try to plot these two functions the plot turns up blank with two axes.

Please halp.


1 Answer 1


Use the correct syntax and let Mathematica do the derivative:

h[x_] := Log[2 x + x Sin[x]]

Plot[{h[x], h'[x]}, {x, 0, 10}]

Mathematica graphics

  • $\begingroup$ Thank you so much, I have been spending hours on this simple problem. $\endgroup$
    – Brantley
    Mar 14, 2014 at 3:55
  • $\begingroup$ @user12967 You need a space to mean "multiplication" and an apostrophe to mean "derivative". As in Math ;) $\endgroup$ Mar 14, 2014 at 4:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.