Linear Nonhomogeneous Differential Equations (continued...)

CS 130: Mathematical Methods in Computer Science Ordinary Differential Equations Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University of the Philippines, Diliman nshernandez@dcs.upd.edu.ph Day 14

Linear Nonhomogeneous Differential Equations (continued...)

Ordinary Differential Equations

Linear Nonhomogeneous Differential Equations (continued...) Reduction of Order Variation of Parameters

Linear Nonhomogeneous Differential Equations (continued...)

Ordinary Differential Equations

Linear Nonhomogeneous Differential Equations (continued...) Reduction of Order Variation of Parameters

Linear Nonhomogeneous Differential Equations (continued...)

Reduction of Order Note that this method is not restricted to equations with constant coefficients. It depends only upon knowing a particular solution of the associated homogeneous equation.

Linear Nonhomogeneous Differential Equations (continued...)

Reduction of Order Note that this method is not restricted to equations with constant coefficients. It depends only upon knowing a particular solution of the associated homogeneous equation.

Example Solve the equation y 00 âˆ’ y = ex .

Linear Nonhomogeneous Differential Equations (continued...)

Reduction of Order Note that this method is not restricted to equations with constant coefficients. It depends only upon knowing a particular solution of the associated homogeneous equation.

Example Solve the equation y 00 âˆ’ y = ex . â†’ yc :

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex → yp :

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex → yp : Suppose yp = vex .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex → yp : Suppose yp = vex . Then yp0 = v 0 ex + vex , and yp00 = v 00 ex + 2v 0 ex + vex .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex → yp : Suppose yp = vex . Then yp0 = v 0 ex + vex , and yp00 = v 00 ex + 2v 0 ex + vex . Substituting to the given ODE, we have v 00 + 2v 0 = 1

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex → yp : Suppose yp = vex . Then yp0 = v 0 ex + vex , and yp00 = v 00 ex + 2v 0 ex + vex . Substituting to the given ODE, we have v 00 + 2v 0 = 1 Solving for v, we have v = 12 x.

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex → yp : Suppose yp = vex . Then yp0 = v 0 ex + vex , and yp00 = v 00 ex + 2v 0 ex + vex . Substituting to the given ODE, we have v 00 + 2v 0 = 1 Solving for v, we have v = 12 x. Thus, yp = 12 xex .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − y = ex . → yc : aux eqn : m2 − 1 = 0 roots: m = −1, 1 yc = c1 e−x + c2 ex → yp : Suppose yp = vex . Then yp0 = v 0 ex + vex , and yp00 = v 00 ex + 2v 0 ex + vex . Substituting to the given ODE, we have v 00 + 2v 0 = 1 Solving for v, we have v = 12 x. Thus, yp = 12 xex . Hence, 1 y = c1 e−x + c2 ex + xex 2

Linear Nonhomogeneous Differential Equations (continued...)

Exercises 00

1. y + y = csc x 2. y 00 + 3y 0 + 2y = sin ex 3. y 00 âˆ’ 2y 0 + y =

ex 1+x2

Linear Nonhomogeneous Differential Equations (continued...)

Variation of Parameters Note that this method is not restricted to equations with constant coefficients. It depends only upon knowing a particular solution of the associated homogeneous equation.

Linear Nonhomogeneous Differential Equations (continued...)

Variation of Parameters Note that this method is not restricted to equations with constant coefficients. It depends only upon knowing a particular solution of the associated homogeneous equation.

Example Solve the equation y 00 âˆ’ 2y 0 + y =

ex 1+x2 .

Linear Nonhomogeneous Differential Equations (continued...)

Variation of Parameters Note that this method is not restricted to equations with constant coefficients. It depends only upon knowing a particular solution of the associated homogeneous equation.

Example Solve the equation y 00 âˆ’ 2y 0 + y = â†’ yc :

ex 1+x2 .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − 2y 0 + y = → yc : aux eqn : m2 − 2m + 1 = 0

ex 1+x2 .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − 2y 0 + y = → yc : aux eqn : m2 − 2m + 1 = 0 roots: m = 1, 1

ex 1+x2 .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − 2y 0 + y = → yc : aux eqn : m2 − 2m + 1 = 0 roots: m = 1, 1 yc = c1 ex + c2 xex

ex 1+x2 .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − 2y 0 + y = → yc : aux eqn : m2 − 2m + 1 = 0 roots: m = 1, 1 yc = c1 ex + c2 xex → yp :

ex 1+x2 .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − 2y 0 + y = → yc : aux eqn : m2 − 2m + 1 = 0 roots: m = 1, 1 yc = c1 ex + c2 xex → yp : Suppose yp = vex + wxex .

ex 1+x2 .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − 2y 0 + y = → yc : aux eqn : m2 − 2m + 1 = 0 roots: m = 1, 1 yc = c1 ex + c2 xex

ex 1+x2 .

→ yp : Suppose yp = vex + wxex . Then yp0 = v 0 ex + vex + w0 xex + w(xex + ex ). That is, yp0 = vex + w(xex + ex ) + v 0 ex + w0 xex .

Linear Nonhomogeneous Differential Equations (continued...)

Example Solve the equation y 00 − 2y 0 + y = → yc : aux eqn : m2 − 2m + 1 = 0 roots: m = 1, 1 yc = c1 ex + c2 xex

ex 1+x2 .

→ yp : Suppose yp = vex + wxex . Then yp0 = v 0 ex + vex + w0 xex + w(xex + ex ). That is, yp0 = vex + w(xex + ex ) + v 0 ex + w0 xex . Let us set v 0 ex + w0 xex = 0. (1)

Linear Nonhomogeneous Differential Equations (continued...)

ex 1+x2 .

→ yp : Suppose yp = vex + wxex . Then yp0 = v 0 ex + vex + w0 xex + w(xex + ex ). That is, yp0 = vex + w(xex + ex ) + v 0 ex + w0 xex . Let us set v 0 ex + w0 xex = 0. (1) Then, yp0 = vex + w(xex + ex ) and yp00 = v 0 ex + vex + w0 (xex + ex ) + w(xex + 2ex ).

Linear Nonhomogeneous Differential Equations (continued...)

ex 1+x2 .

→ yp : Suppose yp = vex + wxex . Then yp0 = v 0 ex + vex + w0 xex + w(xex + ex ). That is, yp0 = vex + w(xex + ex ) + v 0 ex + w0 xex . Let us set v 0 ex + w0 xex = 0. (1) Then, yp0 = vex + w(xex + ex ) and yp00 = v 0 ex + vex + w0 (xex + ex ) + w(xex + 2ex ). Substituting to the given ODE, we have ex v 0 ex + w0 (xex + ex ) = 1+x 2 (2)

Linear Nonhomogeneous Differential Equations (continued...)

Solving for v and w using eqns (1) v 0 ex + w0 xex = 0 and ex (2) v 0 ex + w0 (xex + ex ) = 1+x 2, we have w = tan−1 x and v = − 12 ln(1 + x2 ) .

Linear Nonhomogeneous Differential Equations (continued...)

Solving for v and w using eqns (1) v 0 ex + w0 xex = 0 and ex (2) v 0 ex + w0 (xex + ex ) = 1+x 2, we have w = tan−1 x and v = − 12 ln(1 + x2 ) . Thus, yp = − 21 ex ln(1 + x2 ) + xex tan−1 x.

Linear Nonhomogeneous Differential Equations (continued...)

Solving for v and w using eqns (1) v 0 ex + w0 xex = 0 and ex (2) v 0 ex + w0 (xex + ex ) = 1+x 2, we have w = tan−1 x and v = − 12 ln(1 + x2 ) . Thus, yp = − 21 ex ln(1 + x2 ) + xex tan−1 x. Hence, 1 y = c1 ex + c2 xex − ex ln(1 + x2 ) + xex tan−1 x 2

Linear Nonhomogeneous Differential Equations (continued...)

Exercises 00

0

x

1. 3y − 6y + 6y = e sec x 2. y 00 + 2y 0 + y = e−x ln x

Linear Nonhomogeneous Differential Equations (continued...)

Questions? See you next meeting!

Advertisement