Calculus · real student question

Find the first and second derivatives of f(x) = e^(-x^2) * sin(3x).

Question

Find f(x)f'(x) and f(x)f''(x) for

f(x)=ex2sin(3x)f(x) = e^{-x^2}\sin(3x)

Step-by-step solution

  1. Set up the product rule. With u=ex2u = e^{-x^2} and v=sin(3x)v = \sin(3x), both factors are themselves composites, so the chain rule is needed inside each derivative:

    u=ex2(2x)=2xex2,v=3cos(3x)u' = e^{-x^2}\cdot(-2x) = -2xe^{-x^2}, \qquad v' = 3\cos(3x)

    The inner derivatives 2x-2x and 33 are the two factors most often dropped here.

  2. Assemble the first derivative and factor.

    f(x)=2xex2sin(3x)+3ex2cos(3x)=ex2(3cos3x2xsin3x)f'(x) = -2xe^{-x^2}\sin(3x) + 3e^{-x^2}\cos(3x) = e^{-x^2}\left(3\cos 3x - 2x\sin 3x\right)

    Pulling ex2e^{-x^2} out front keeps the second differentiation manageable.

  3. Differentiate the bracket for the second derivative. Let w=3cos3x2xsin3xw = 3\cos 3x - 2x\sin 3x. Then

    w=9sin3x(2sin3x+6xcos3x)=11sin3x6xcos3xw' = -9\sin 3x - \left(2\sin 3x + 6x\cos 3x\right) = -11\sin 3x - 6x\cos 3x

    The 2xsin3x-2x\sin 3x term needs the product rule again, contributing both 2sin3x-2\sin 3x and 6xcos3x-6x\cos 3x.

  4. Apply the product rule once more.

    f(x)=uw+uw=2xex2(3cos3x2xsin3x)+ex2(11sin3x6xcos3x)f''(x) = u'w + uw' = -2xe^{-x^2}\left(3\cos 3x - 2x\sin 3x\right) + e^{-x^2}\left(-11\sin 3x - 6x\cos 3x\right)

  5. Collect the sine and cosine terms. The cosine terms give 6x6x=12x-6x - 6x = -12x and the sine terms give 4x2114x^2 - 11:

    f(x)=ex2((4x211)sin3x12xcos3x)f''(x) = e^{-x^2}\left(\left(4x^2 - 11\right)\sin 3x - 12x\cos 3x\right)

  6. Check at x = 0. From the formulas, f(0)=1(30)=3f'(0) = 1\cdot(3 - 0) = 3 and f(0)=1(1100)=0f''(0) = 1\cdot(-11\cdot 0 - 0) = 0. Directly, near 00 we have f(x)(1x2)(3x9x32)=3x+O(x3)f(x) \approx (1-x^2)(3x - \tfrac{9x^3}{2}) = 3x + O(x^3), so the slope at the origin is 33 and the second derivative vanishes — both confirmed.

Answer

f(x)=ex2(3cos3x2xsin3x),f(x)=ex2((4x211)sin3x12xcos3x)f'(x) = e^{-x^2}\left(3\cos 3x - 2x\sin 3x\right), \qquad f''(x) = e^{-x^2}\left(\left(4x^2-11\right)\sin 3x - 12x\cos 3x\right)

Need to solve a different problem like this? Open the solver →