indeed, you must use the cmath header...
pow() and also sqrt() will find the square root of a number xD
pow takes to aruments first is the number to be raised to the powerof the second number if that makes sense.
Also i should talk about the chain rule.
the chain rule can be used to find the derivative of (ax+b)^z in a few simple steps.
It also applies to finding the derivative of e^(x-3x^2) in your case
the chain rule is this
dy/dx = du/dx * dy/du
now where does you come into well we set the power of e = u so
e^(x-3x^2) becomes
u = x-3x^2
therefore, we get this
f(x) = e^u therefore dy/du = e^u.
but we must find the derivative of u
u = x-3x^2
du/dx = x-6x
so back to the chain rule.
dy/dx = du/dx * dy/du
dy/dx = (x-6x) * (e^u)
dy/dx = (x-6x)(e^(x-3x^2))
Hope that helps you with finding the correct derivative.
Chris