Travou nisso? Resolva com IA
Calculus · real student question

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

Question

Find the general solution of

dydx=2y−x\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):

    dydx−2y=−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)=e∫P dx=e∫−2 dx=e−2x\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.

    e−2xdydx−2e−2xy=−xe−2x⟹ddx(ye−2x)=−xe−2xe^{-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=−e−2xdxdv=-e^{-2x}dx, so du=dxdu=dx and v=12e−2xv=\tfrac12 e^{-2x}:

    ∫−xe−2x dx=x2e−2x−∫12e−2x dx=x2e−2x+14e−2x+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 2y−x=2Ce2x+x+12−x=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 →