Calculus · real student question

Solve the differential equation dy/dx = 2y - x.

Question

Find the general solution of

dydx=2yx\frac{dy}{dx}=2y-x

Step-by-step solution

  1. Put the equation in standard linear form. Move the yy term to the left so it reads y+P(x)y=Q(x)y'+P(x)y=Q(x):

    dydx2y=x,P(x)=2,Q(x)=x\frac{dy}{dx}-2y=-x,\qquad P(x)=-2,\quad Q(x)=-x

  2. Build the integrating factor.

    μ(x)=ePdx=e2dx=e2x\mu(x)=e^{\int P\,dx}=e^{\int-2\,dx}=e^{-2x}

    Its purpose is to make the left-hand side a single derivative, which is what turns the ODE into a plain integration.

  3. Multiply through and recognise the product derivative.

    e2xdydx2e2xy=xe2xddx(ye2x)=xe2xe^{-2x}\frac{dy}{dx}-2e^{-2x}y=-xe^{-2x}\quad\Longrightarrow\quad\frac{d}{dx}\left(ye^{-2x}\right)=-xe^{-2x}

  4. Integrate the right side by parts. Take u=xu=x, dv=e2xdxdv=-e^{-2x}dx, so du=dxdu=dx and v=12e2xv=\tfrac12 e^{-2x}:

    xe2xdx=x2e2x12e2xdx=x2e2x+14e2x+C\int -xe^{-2x}\,dx=\frac{x}{2}e^{-2x}-\int\frac{1}{2}e^{-2x}\,dx=\frac{x}{2}e^{-2x}+\frac{1}{4}e^{-2x}+C

  5. Solve for yy and verify. Multiply through by e2xe^{2x}:

    y=Ce2x+x2+14y=Ce^{2x}+\frac{x}{2}+\frac{1}{4}

    Check: y=2Ce2x+12y'=2Ce^{2x}+\tfrac12, while 2yx=2Ce2x+x+12x=2Ce2x+122y-x=2Ce^{2x}+x+\tfrac12-x=2Ce^{2x}+\tfrac12 \checkmark. The two agree for every CC, and x2+14\tfrac{x}{2}+\tfrac14 is the particular solution while Ce2xCe^{2x} is the homogeneous part.

Answer

y=Ce2x+x2+14y=Ce^{2x}+\frac{x}{2}+\frac{1}{4}

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