Calculus · real student question

Solve the differential equation y'' - 3y' + 2y = e^x.

Question

Solve

y3y+2y=exy'' - 3y' + 2y = e^{x}

Step-by-step solution

  1. Solve the homogeneous equation first. Substituting y=erxy = e^{rx} into y3y+2y=0y'' - 3y' + 2y = 0 gives the characteristic equation

    r23r+2=(r1)(r2)=0r=1, 2r^2 - 3r + 2 = (r-1)(r-2) = 0 \quad\Longrightarrow\quad r = 1,\ 2

    so yh=C1ex+C2e2xy_h = C_1e^{x} + C_2e^{2x}. This has to be found before the particular solution, because it tells you whether the forcing term is resonant.

  2. Detect the resonance. The forcing term exe^{x} has exponent 11, which is one of the characteristic roots — exe^{x} is already a homogeneous solution. Trying yp=Aexy_p = Ae^{x} would substitute to 00, never to exe^{x}, so that trial can never work.

  3. Multiply the trial by x. The standard fix for a simple root is one extra factor of xx: take yp=Axexy_p = Axe^{x}. Then

    yp=A(1+x)ex,yp=A(2+x)exy_p' = A(1 + x)e^{x}, \qquad y_p'' = A(2 + x)e^{x}

  4. Substitute and match coefficients.

    A(2+x)ex3A(1+x)ex+2Axex=Aex[(2+x)3(1+x)+2x]=AexA(2+x)e^{x} - 3A(1+x)e^{x} + 2Axe^{x} = A e^{x}\left[(2+x) - 3(1+x) + 2x\right] = -Ae^{x}

    The xx terms cancel exactly — the signature of a correctly chosen resonant trial. Setting Aex=ex-Ae^x = e^x gives A=1A = -1, so yp=xexy_p = -xe^{x}.

  5. Assemble and verify the general solution.

    y=C1ex+C2e2xxexy = C_1e^{x} + C_2e^{2x} - xe^{x}

    Check: with yp=xexy_p = -xe^x, yp=(1+x)exy_p' = -(1+x)e^x and yp=(2+x)exy_p'' = -(2+x)e^x, so yp3yp+2yp=ex[(2+x)+3(1+x)2x]=exy_p'' - 3y_p' + 2y_p = e^x\left[-(2+x) + 3(1+x) - 2x\right] = e^x, as required.

Answer

y=C1ex+C2e2xxexy = C_1e^{x} + C_2e^{2x} - xe^{x}

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