# Solve the initial value problem use integrating factor y' + (x - 1)y = xe^x, y(0) = -2

## Question:

Solve the initial value problem using an integrating factor {eq}y' + (x - 1)y = xe^x, \: y(0) = -2 {/eq}

## Integrating Factors:

If we have a linear differential equation {eq}y' + p(x) y = q(x), {/eq} then an integrating factor for the differential equation is {eq}\mu(x) = e^{\int p(x) \: dx}. {/eq} Multiplying both sides of the differential equation by {eq}\mu {/eq} makes the left hand side equal to the derivative of {eq}y e^{\int p(x) \: dx}. {/eq} We then integrate both sides of the new equation, and solve for {eq}y. {/eq}

We have {eq}p(x) = x - 1 {/eq} and {eq}q(x) = x e^x. {/eq} The integrating factor is {eq}\mu (x) = e^{\int p(x) \: dx} = e^{\int x - 1 \: dx} = e^{\frac{x^2}2 - x}. {/eq} Multiplying both sides of the differential equation by this integrating factor gives

{eq}\begin{eqnarray*}e^{\frac{x^2}2 - x} (y' + (x - 1) y) & = & x e^x e^{\frac{x^2}2 - x} \\ \\ e^{\frac{x^2}2 - x} y' + (x - 1) y e^{\frac{x^2}2 - x} & = & x e^{\frac{x^2}2} \\ \\ \displaystyle\frac{d}{dx} \left[ y e^{\frac{x^2}2 - x} \right] & = & x e^{\frac{x^2}2} \\ \\ \int \displaystyle\frac{d}{dx} \left[ y e^{\frac{x^2}2 - x} \right] & = & \int x e^{\frac{x^2}2} \\ \\ y e^{\frac{x^2}2 - x} & = & e^{\frac{x^2}2} + C \\ \\ y & = & e^{x - \frac{x^2}2} \left[ e^{\frac{x^2}2} + C \right] \\ \\ & = & e^x + C e^{x - \frac{x^2}2} \end{eqnarray*} {/eq}

To determine the value of {eq}C, {/eq} we use {eq}y(0) = -2, {/eq} so

{eq}\begin{eqnarray*}y(0) & = & e^0 + C e^{0} \\ -2 & = & 1 + C \\ C & = & -3 \end{eqnarray*} {/eq}

Therefore the solution to the initial value problem is {eq}y = e^x - 3 e^{x - \frac{x^2}2}. {/eq}

First-Order Linear Differential Equations

from

Chapter 16 / Lesson 3
1.8K

In this lesson you'll learn how to solve a first-order linear differential equation. We first define what such an equation is, and then we give the algorithm for solving one of that form. Specific examples follow the more general description of the method.