How to solve a differential equation by changing variables

Sometimes the right side of a differential equation is easier to work with as one expression. We can give that expression a new name, find an equation for it, and solve that equation first. Let’s try it with a right side that mixes both variables.

Choose a substitution that simplifies the equation

y′=2x+y

Let u=2x+y. Here u=y′, and differentiating u=2x+y gives u′=2+y′. Substitute u for y′ to get an equation we can separate.

dudx=u+2

Separate and integrate

First take a solution for which u+2 is nonzero. Divide by u+2 and integrate.

1u+2du=dxln|u+2|=x+C0u+2=Cex

The logarithm gives an absolute value, so C can be positive or negative. The equation for u also has the constant solution u=-2. We can include that solution by letting C=0.

Return to the original variable

Since u=2x+y, substitute it back and isolate y.

2x+y+2=Cexy=Cex-2x-2

To check the result, differentiate to get y′=Cex-2. Substituting our solution into 2x+y gives the same expression. With C=0, the original equation still holds and the solution is y=-2x-2.

When can we use the same substitution?

For y′=ay+bx+c with constant coefficients and a≠0, let u=ay+bx+c. Then u′=au+b, which separates. For a different right side, check the equation for u before trying to separate it.