Kim’s Math NotesCourse index

Verifying Solutions for Differential Equations

How can I check whether a proposed function solves a differential equation?

Decide whether a function is a solution of a differential equation by putting it in, without solving, and use a point to pick one solution from a family.

One point is not enough

Common mistake y=x2 for y′=2y−x2? At x=0: 0=0, so it is a solution.

Correction y′=2x but 2y−x2=x2: equal only at x=0 and x=2. Not a solution.

A point alone does not make a solution

Common mistake y=3x+1 passes through (0,1), so it solves y′=x+y, y(0)=1.

Correction Check the equation first: y′=3 but x+y=4x+1. Not a solution, even through the point.

A function that works

Start with x times d y d x equals two y. Divide by x, wherever x isn't zero: the equation asks for the slope two y over x. Try y equals x squared. At one, one, the equation asks for two times one over one: two. The curve's tangent there has slope two. A match.

At two, four, it asks for two times four over two: four.

Watch this part of the concept lesson

Read the rest of this scene

The tangent has slope four. Another match. Two matches. So is that proof? Not yet. A stopped clock is right twice a day. Two points can't speak for every point. So check every x at once.

For y equals x squared, y prime equals two x. Put it into the original equation: x times two x is two x squared. That's two y. It matches. Same expression on both sides, so it holds for every x, even at x equals zero, where we couldn't divide. When the equation is true for every x on an interval, the function is called a solution of the differential equation on that interval.

Here that's every real x, so y equals x squared is a solution.

A function that fails

Now a function that fails. Same equation, but y equals x cubed. At one, one, the curve's slope is three. But the equation asks for two times one over one: two. They don't match. Now check every x.

y equals x cubed has y prime equals three x squared.

Watch this part of the concept lesson

Read the rest of this scene

If it were a solution, that slope would have to equal two y over x, for x not zero. Multiply by x and divide by two: y equals three halves x cubed. But our y is x cubed, not three halves x cubed. So y equals x cubed is not a solution.

A whole family of solutions

Is x squared the only solution? Try a whole family: y equals C x squared, for any constant C. Then y prime is two C x. Put it in: x times two C x is two C x squared. That's two y, for every C.

C equals one gives x squared.

Watch this part of the concept lesson

Read the rest of this scene

C equals two is narrower. C equals one half is wider. C equals negative one is upside down. And C equals zero: y equals zero, flat on the x axis. Check it: y prime is zero, x times zero is zero, and two y is zero.

A constant function can be a solution too. Every one of them is a solution: one equation, a whole family of solutions. Now find the one through the point one, three. Plug in x equals one and y equals three: C times one squared is three. So C is three: the pink one.

So the point one, three picks one curve from this family. It's the same move you made in six point eight, finding C from a point, but now y is inside the equation, and we only check.

When y'' shows up

Now an equation with y double prime: y double prime plus nine y equals zero. Move nine y over: it asks for y double prime to be negative nine times y. Try y equals sine of three x. Where did that come from? Don't worry. Finding functions like this isn't part of AP Calculus.

You only check them.

Watch this part of the concept lesson

Read the rest of this scene

For the first derivative, use the chain rule: y prime is three cosine three x. Take the derivative once more, with the chain rule again: cosine turns into negative sine, and another three comes out. Three times three is nine, so y double prime is negative nine sine three x. That's negative nine times y. In the picture, y is green.

y double prime is pink, negative nine times as tall, at every x, not just one point. At pi over six, they're one and negative nine. Put them into the equation: negative nine sine three x, plus nine sine three x, is zero, for every x. So y equals sine three x is a solution. With y double prime, you just take two derivatives.

The check is the same. On the AP exam, a question can ask you to verify that a function is a solution of a differential equation. That means: put it in, and show both sides match. You don't have to solve anything. If there's an initial condition, check it as its own step.

Example 1: verify a solution

Example one. Show that y equals two e to the x, minus x, minus one, is a solution of the differential equation d y d x equals x plus y, with the initial condition y of zero equals one. The curve is drawn for you. The plan: work out each side by itself, check they're the same, then check the point. The left side is y prime: two e to the x stays two e to the x, the minus x gives minus one, and the constant minus one at the end gives zero.

The right side is x plus y.

Watch this part of the concept lesson

Read the rest of this scene

Plug in y: x, plus two e to the x, minus x, minus one. x and negative x cancel, leaving two e to the x, minus one. The two sides are the same expression, so they match for every x, not just one. Then the point, as its own step: y of zero is two e to the zero, minus zero, minus one, which is two minus one, or one. On the curve, the slope at zero, one is zero plus one, which is one.

So both checks pass. y equals two e to the x, minus x, minus one, is a solution, and it meets y of zero equals one. Alright. When you do these in your workbook: both sides first, then the point, every step on paper.

The one-point trap

Here's where a check can fool you. A fast answer checks y of zero equals one, and stops. Or it compares the two sides only at x equals zero. Watch. Take the straight line y equals x plus one: the pink line from the example. y of zero is zero plus one, which is one. It passes.

At x equals zero, its slope is one.

Watch this part of the concept lesson

Read the rest of this scene

And x plus y is zero plus one, which is one. It passes there too. Now check every x. The left side, y prime, is one. The right side, x plus y, is x plus x plus one: two x plus one.

One equals two x plus one only at x equals zero. So y equals x plus one is not a solution. Look at x equals one: the line is at two, and the curve is already higher. The line leaves the curve right after zero. It's the stopped clock: right at one point, wrong everywhere else.

Show the two sides are the same expression, so they match for every x. One point is never enough. Then check the initial condition as a separate step: two checks, both written down.

Example 2: which r works?

Example two. For which values of r is y equals x to the r a solution of x squared y double prime, minus two y, equals zero, for x greater than zero? Choice A: two only. Choice B: negative one only. Choice C: two and negative one.

Choice D: negative two and one.

Watch this part of the concept lesson

Read the rest of this scene

The plan: two derivatives, put them in, then solve for r. And x greater than zero is the interval where it has to hold. y prime is r x to the r minus one. y double prime is r times the quantity r minus one, times x to the r minus two. Multiply by x squared: x squared, times r times r minus one, times x to the r minus two.

The powers add: two plus r minus two is r. So x squared y double prime is r times r minus one, times x to the r. Now the whole left side, x squared y double prime minus two y, with y equals x to the r: r times r minus one, times x to the r, minus two x to the r. Factor out x to the r: the quantity r times r minus one, minus two, times x to the r, is zero. For x greater than zero, x to the r is a positive number, never zero, even when r is negative.

So r squared minus r minus two is zero. Factor: r minus two, times r plus one. So r is two, or negative one. Both work. Don't drop the negative one: two only is choice A, the trap. And D has the signs flipped.

So the answer is C: two and negative one. For the ones in your workbook: take two derivatives, put them in, then solve.

Worked examples

Example 1

Show that y=2ex−x−1 is a solution of the differential equation dydx=x+y with the initial condition y(0)=1.
Hint

Work out each side by itself, then the point.

Answer and solution

Answer both sides are 2ex−1 for every x; y(0)=1

  1. y′=2ex−1
  2. x+y=x+2ex−x−1=2ex−1
  3. Both sides are 2e^x - 1 for every x, so it is a solution.
  4. y(0)=2e0−0−1=1

Example 2

For which values of r is y=xr a solution of x2y′′−2y=0 for x>0?
  1. 2 only
  2. −1 only
  3. 2 and −1
  4. −2 and 1
Hint

Two derivatives, put them in, factor out xr.

Answer and solution

Answer C. 2 and −1

  1. y′=rxr−1,y′′=r(r−1)xr−2
  2. x2⋅r(r−1)xr−2−2xr=(r2−r−2)xr=0
  3. x^r is not 0 for x > 0, so (r - 2)(r + 1) = 0: r = 2 or r = -1. Answer C.

Workbook

Problem 1

Which function is a solution of the differential equation dydx=−2xy?
  1. y=e−x2
  2. y=e−2x
  3. y=−x2
  4. y=ex2
Hint

Find y′ for each choice. It must equal −2xy for every x, not at one point.

Answer and solution

Answer A. y=e−x2

  1. y=e−x2:y′=−2xe−x2=−2x⋅y
  2. The two sides match for every x. Answer A.

Common mistake Checking at one point instead of for every x; a sign error in y'.

Watch the worked solution to Problem 1

Problem 2

Show that y=3e2x+1 is a solution of the differential equation dydx=2y−2 with the initial condition y(0)=4.
Hint

Work out each side by itself. Then check the initial condition.

Answer and solution

Answer both sides are 6e2x for every x, and y(0)=4

  1. y′=6e2x,2y−2=6e2x+2−2=6e2x
  2. y(0)=3+1=4
  3. Both sides are 6e^{2x} for every x, so it is a solution, and y(0) = 4.

Common mistake Stopping after one side, or skipping the initial condition.

Watch the worked solution to Problem 2

Problem 3

For what value of k is y=kx2+x a solution of xdydx−y=4x2?
  1. 1
  2. 2
  3. 4
  4. 8
Hint

Find y′, put y and y′ into the left side, and simplify. It must equal 4x2 for every x.

Answer and solution

Answer C. 4

  1. y′=2kx+1
  2. x(2kx+1)−(kx2+x)=kx2=4x2→k=4
  3. Answer C.

Common mistake Comparing at one value of x instead of for every x.

Watch the worked solution to Problem 3

Problem 4

Consider the differential equation dydx=2x−y.
  1. Show that y=Ce−x+2x−2 is a solution for every constant C.
  2. Find the solution whose graph passes through (0,1).
Hint

For (a) keep C as a letter. For (b) put the point in.

Answer and solution
  1. both sides are −Ce−x+2
  2. y=3e−x+2x−2
  1. y′=−Ce−x+2,2x−y=−Ce−x+2
  2. C−2=1→C=3
  3. The point (0, 1) picks one curve of the family: y = 3e^{-x} + 2x - 2.

Common mistake Choosing a number for C in (a) instead of keeping it a letter.

Watch the worked solution to Problem 4

Problem 5

Which of the following are solutions of y′′=4y?
I. y=e2x
II. y=e−2x+3
III. y=5e−2x
  1. I only
  2. I and II only
  3. I and III only
  4. I, II, and III
Hint

Two derivatives for each, then compare y′′ with 4y. A constant changes 4y, not y′′.

Answer and solution

Answer C. I and III only

  1. I:4e2x=4e2x;II:4e−2x≠4e−2x+12;III:20e−2x=20e−2x
  2. I and III only. Answer C.

Common mistake Thinking a constant added to a solution is still a solution.

Watch the worked solution to Problem 5

Problem 6

Consider the differential equation dydx=−y2.
  1. Show that y=1x+C is a solution for every constant C.
  2. Find the solution with y(1)=13.
  3. Is y=2x+C also a solution? Explain your reasoning.
Hint

Write y=(x+C)−1 to differentiate.

Answer and solution
  1. both sides are −1(x+C)2
  2. y=1x+2
  3. no: y′=−2(x+C)2, but −y2=−4(x+C)2
  1. y′=−1(x+C)2=−y2
  2. 11+C=13→C=2
  3. y′=−2(x+C)2,−y2=−4(x+C)2

Common mistake Treating 2/(x + C) like 1/(x + C) without checking both sides.

Watch the worked solution to Problem 6

Problem 7

Find all values of k for which y=ekx is a solution of the differential equation y′′−y′−6y=0.
Hint

Take two derivatives, put y, y′, y′′ in, and factor out ekx. Why may you divide by it?

Answer and solution

Answer k=3 and k=−2

  1. y′=kekx,y′′=k2ekx
  2. k2ekx−kekx−6ekx=(k2−k−6)ekx=0
  3. e^{kx} is never 0, so k^2 - k - 6 = (k - 3)(k + 2) = 0: k = 3 or k = -2.

Common mistake Stopping after y'; forgetting why we may divide by e^{kx}.

Watch the worked solution to Problem 7