Calculus · real student question

Solve the differential equation dy/dx + ay = b, where a and b are constants.

Question

Find the general solution of

dydx+ay=b\frac{dy}{dx}+ay=b

where aa and bb are constants. Treat the case a=0a=0 separately.

Step-by-step solution

  1. Identify the standard form. The equation is already y+P(x)y=Q(x)y'+P(x)y=Q(x) with constant coefficients:

    P(x)=a,Q(x)=bP(x)=a,\qquad Q(x)=b

  2. Compute the integrating factor.

    μ(x)=eadx=eax\mu(x)=e^{\int a\,dx}=e^{ax}

  3. Multiply through and collapse the left side.

    eaxdydx+aeaxy=beaxddx(eaxy)=beaxe^{ax}\frac{dy}{dx}+ae^{ax}y=be^{ax}\quad\Longrightarrow\quad\frac{d}{dx}\left(e^{ax}y\right)=be^{ax}

  4. Integrate, assuming a0a\neq 0.

    eaxy=baeax+Cy=ba+Ceaxe^{ax}y=\frac{b}{a}e^{ax}+C\quad\Longrightarrow\quad y=\frac{b}{a}+Ce^{-ax}

    The division by aa is exactly why a=0a=0 needs its own treatment.

  5. Handle a=0a=0. The equation degenerates to dydx=b\tfrac{dy}{dx}=b, whose solution is a straight line:

    y=bx+Cy=bx+C

  6. Verify and interpret. For a0a\neq 0: y=aCeaxy'=-aCe^{-ax} and ay=b+aCeaxay=b+aCe^{-ax}, so y+ay=by'+ay=b \checkmark (numerically confirmed at a=1.3a=1.3, b=2.1b=2.1, C=0.7C=0.7, x=0.6x=0.6). The constant ba\tfrac{b}{a} is the equilibrium: if a>0a>0 every solution decays towards it, which is the shape behind Newton's law of cooling and RC circuit charging.

Answer

y=ba+Ceax (a0);y=bx+C (a=0)y=\frac{b}{a}+Ce^{-ax}\ (a\neq 0);\qquad y=bx+C\ (a=0)

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