### Second-Order Linear Equations #### Definition The general second-order linear differential equation is: $$ \frac{d^2y}{dx^2} + P(x)\frac{dy}{dx} + Q(x)y = R(x) $$ or, simply, $$ y'' + P(x)y' + Q(x)y = R(x) $$ Here, $P(x)$, $Q(x)$, and $R(x)$ are functions of $x$ alone (or just constants). #### Examples 1. $y'' + y = 0$ Here $P(x) = 0$, $Q(x) = 1$, and $R(x) = 0$. 2. $x^2y'' + 2xy' - 2y = 0$ This becomes obvious when we rewrite it in the standard form: $$ y'' + \frac{2}{x}y' - \frac{2}{x^2}y = 0 $$ Hence $P(x) = \frac{2}{x}$, $Q(x) = -\frac{2}{x^2}$, and $R(x) = 0$. 3. $(1-x^2)\frac{d^2y}{dx^2} - 2x\frac{dy}{dx} + p(p+1)y = 0$ (What are $P(x)$, $Q(x)$, and $R(x)$?) Standard form: $y'' - \frac{2x}{1-x^2}y' + \frac{p(p+1)}{1-x^2}y = 0$. So, $P(x) = -\frac{2x}{1-x^2}$, $Q(x) = \frac{p(p+1)}{1-x^2}$, $R(x) = 0$. 4. $x^2\frac{d^2y}{dx^2} + x\frac{dy}{dx} + (x^2-p^2)y = 0$ (What are $P(x)$, $Q(x)$, and $R(x)$?) Standard form: $y'' + \frac{1}{x}y' + (1-\frac{p^2}{x^2})y = 0$. So, $P(x) = \frac{1}{x}$, $Q(x) = 1-\frac{p^2}{x^2}$, $R(x) = 0$. ### Existence and Uniqueness Theorem #### Theorem Let $P(x)$, $Q(x)$, and $R(x)$ be continuous functions on a closed interval $[a, b]$. If $x_0$ is any point in $[a, b]$ and if $y_0$ and $y_0'$ are any numbers, then the equation $$ \frac{d^2y}{dx^2} + P(x)\frac{dy}{dx} + Q(x)y = R(x) $$ has one and only one solution $y(x)$ on the entire interval such that $y(x_0) = y_0$ and $y'(x_0) = y_0'$. #### Note The theorem implies that for any given point $x_0$ in $[a, b]$ and any choice of the numbers $y_0$ and $y_0'$, the differential equation has a unique solution on $[a, b]$ that passes through the point $(x_0, y_0)$ and has the slope $y_0'$ at $(x_0, y_0)$. #### Example Find the solution of the initial value problem $y'' + y = 0$, $y(0) = 0$ and $y'(0) = 1$. **Solution:** We see that $y = \sin x$ is a solution of the given differential equation: $y'' + y = -\sin x + \sin x = 0$. We finally note that the solution $y = \sin x$ also satisfies the given initial conditions. Therefore, by the theorem, $y = \sin x$ is the unique solution of the given initial value problem. #### Example Find the solution of the initial value problem $y'' + y = 0$, $y(0) = 1$ and $y'(0) = 0$. **Solution:** We note that $y = \cos x$ is a solution of this initial value problem. From the theorem, we conclude that $y = \cos x$ is the unique solution of the initial value problem. ### Homogeneous Equations #### Definition A differential equation of the form $$ y'' + P(x)y' + Q(x)y = 0 $$ is called a **homogeneous equation**. In contrast, the differential equation $$ y'' + P(x)y' + Q(x)y = R(x) $$ in which $R(x)$ is not identically zero is called a **non-homogeneous equation**. In this context, the equation $y'' + P(x)y' + Q(x)y = R(x)$ is called the **complete equation** and the corresponding homogeneous equation $y'' + P(x)y' + Q(x)y = 0$ that is obtained by replacing $R(x)$ with $0$ is called the **associated reduced equation**. #### Note In obtaining the solution of a non-homogeneous equation $y'' + P(x)y' + Q(x)y = R(x)$, we will have to always consider the associated homogeneous equation also: Suppose $y_g(x, c_1, c_2)$ is the general solution of the corresponding reduced homogeneous equation $y'' + P(x)y' + Q(x)y = 0$. And suppose $y_p(x)$ is any one fixed particular solution of the given complete non-homogeneous equation. Let $y(x)$ be any solution of the given non-homogeneous equation. It then follows that $y - y_p$ is a solution of the reduced homogeneous equation: $$ (y - y_p)'' + (y - y_p)'P + (y - y_p)Q = [y'' + Py' + Qy] - [y_p'' + P y_p' + Q y_p] = R - R = 0 $$ But $y_g(x, c_1, c_2)$ is the general solution of $y'' + P(x)y' + Q(x)y = 0$. $\therefore y(x) - y_p(x) = y_g(x, c_1, c_2)$ for some choice of the constants $c_1$ and $c_2$. $\therefore y(x) = y_g(x, c_1, c_2) + y_p(x)$ for some choice of the constants $c_1$ and $c_2$. #### Theorem Consider the non-homogeneous equation $y'' + P(x)y' + Q(x)y = R(x)$. If $y_g$ is the general solution of the corresponding reduced homogeneous equation $y'' + P(x)y' + Q(x)y = 0$ and $y_p$ is any particular solution of the given complete non-homogeneous equation, then $y_g + y_p$ is the general solution of the complete equation. #### Theorem If $y_1(x)$ and $y_2(x)$ are any two solutions of the homogeneous equation $y'' + P(x)y' + Q(x)y = 0$, then $c_1y_1(x) + c_2y_2(x)$ is also a solution for any constants $c_1$ and $c_2$. **Proof:** $$ (c_1y_1 + c_2y_2)'' + P(x)(c_1y_1 + c_2y_2)' + Q(x)(c_1y_1 + c_2y_2) $$ $$ = (c_1y_1'' + c_2y_2'') + P(x)(c_1y_1' + c_2y_2') + Q(x)(c_1y_1 + c_2y_2) $$ $$ = c_1[y_1'' + P(x)y_1' + Q(x)y_1] + c_2[y_2'' + P(x)y_2' + Q(x)y_2] $$ Since $y_1$ and $y_2$ are solutions to the homogeneous equation, the terms in the square brackets are zero: $$ = c_1 \cdot 0 + c_2 \cdot 0 = 0 $$ Thus, $c_1y_1(x) + c_2y_2(x)$ is a solution. #### Note 1. $c_1y_1(x) + c_2y_2(x)$ is called a **linear combination** of $y_1(x)$ and $y_2(x)$. 2. If we have managed to find two solutions of the equation $y'' + P(x)y' + Q(x)y = 0$, then this theorem provides us another solution which involves two arbitrary constants and thus may be the general solution. 3. But if either $y_1$ or $y_2$ is a constant multiple of the other, say $y_1 = ky_2$, then $c_1y_1 + c_2y_2 = c_1(ky_2) + c_2y_2 = (c_1k + c_2)y_2 = Cy_2$, and thus $c_1y_1 + c_2y_2$ has essentially only one arbitrary constant. 4. Thus it may be expected that if neither $y_1$ nor $y_2$ is a constant multiple of the other, then $c_1y_1(x) + c_2y_2(x)$ is the general solution of $y'' + P(x)y' + Q(x)y = 0$. 5. This is indeed true and will be proved shortly! #### Example Solve $y'' + y' = 0$. **Solution:** By inspection, we see that $y_1 = 1$ and $y_2 = e^{-x}$ are solutions of the given differential equation. It is also obvious that neither function is a constant multiple of the other. Thus by the theorem to be proved, $y = c_1 + c_2e^{-x}$ is the general solution. #### Example Solve $x^2y'' + 2xy' - 2y = 0$. **Solution:** The form of the differential equation suggests that it might possibly have solutions of the form $y = x^n$. On substituting this in the differential equation, we obtain $x^n(n(n-1) + 2n - 2) = 0$ or $n(n-1) + 2n - 2 = 0$ or $n^2 + n - 2 = 0$. The last equation above has roots $n=1$ and $n=-2$. Thus $y_1 = x$ and $y_2 = x^{-2}$ are solutions of the given differential equations. Since neither of this function is a constant multiple of the other, it follows that $y = c_1x + c_2x^{-2}$ is the general solution of the equation on any interval not containing $0$. ### Linearly Dependent/Independent Functions #### Definition Let $f(x)$ and $g(x)$ be two functions defined on an interval $[a, b]$. If any one of these functions is a constant multiple of the other, then they are said to be **linearly dependent** on $[a, b]$. Otherwise - that is, if neither is a constant multiple of the other - they are called **linearly independent**. #### Example Suppose $f(x) \equiv 0$ on $[a, b]$; i.e., it is identically zero on $[a, b]$. Then $f(x)$ and $g(x)$ are linearly dependent for any function $g(x)$ as $f(x) = 0 \cdot g(x)$. ### The General Solution of the Homogeneous Equation #### Theorem Let $y_1(x)$ and $y_2(x)$ be linearly independent solutions of the homogeneous equation $y'' + P(x)y' + Q(x)y = 0$ on the interval $[a, b]$. Then $c_1y_1(x) + c_2y_2(x)$ is the general solution of the differential equation on $[a, b]$. The theorem will follow from an observation and two lemmas that we will be proving now. #### Note Recall: A solution $y(x)$ of a second-order linear equation on an interval $[a, b]$ is uniquely determined by $y(x_0)$ and $y'(x_0)$, where $x_0$ is any point from the interval $[a, b]$. Let $y_1(x)$ and $y_2(x)$ be two linearly independent solutions of the homogeneous equation $y'' + P(x)y' + Q(x)y = 0$ on the interval $[a, b]$. Our goal is to prove that $c_1y_1(x) + c_2y_2(x)$ is the general solution of the differential equation on $[a, b]$. That is, we want to prove that if $y(x)$ is any solution of the equation on $[a, b]$, then there is a choice of the constants $c_1$ and $c_2$ such that $y(x) = c_1y_1(x) + c_2y_2(x)$. Let $x_0$ be any point from the interval $[a, b]$. By the theorem stated above, such a choice of constants $c_1$ and $c_2$ will be possible if the system: $$ c_1y_1(x_0) + c_2y_2(x_0) = y(x_0) $$ $$ c_1y_1'(x_0) + c_2y_2'(x_0) = y'(x_0) $$ has a solution for $c_1$ and $c_2$. And the system will have a solution if the determinant $$ \begin{vmatrix} y_1(x_0) & y_2(x_0) \\ y_1'(x_0) & y_2'(x_0) \end{vmatrix} = y_1(x_0)y_2'(x_0) - y_2(x_0)y_1'(x_0) \neq 0 $$ #### The Wronskian ##### Definition Let $y_1$ and $y_2$ be any functions of $x$. Then their **Wronskian** is given by $$ W(y_1, y_2) = \begin{vmatrix} y_1 & y_2 \\ y_1' & y_2' \end{vmatrix} = y_1y_2' - y_2y_1' $$ ##### Lemma 1 If $y_1(x)$ and $y_2(x)$ are any two solutions of the homogeneous linear equation $y'' + P(x)y' + Q(x)y = 0$ on the interval $[a, b]$, then their Wronskian $W(y_1, y_2)$ is either identically zero or never zero on $[a, b]$. **Proof:** The Wronskian of $y_1$ and $y_2$ is $W = W(y_1, y_2) = y_1y_2' - y_2y_1'$. $$ \frac{dW}{dx} = y_1y_2'' + y_1'y_2' - (y_2'y_1' + y_2y_1'') = y_1y_2'' - y_2y_1'' $$ Also since $y_1$ and $y_2$ are solutions of $y'' + P(x)y' + Q(x)y = 0$, we have $y_1'' + P y_1' + Q y_1 = 0$ $y_2'' + P y_2' + Q y_2 = 0$. Now multiply the first of the above equations by $y_2$ and the second by $y_1$: $y_2y_1'' + P y_2y_1' + Q y_2y_1 = 0$ $y_1y_2'' + P y_1y_2' + Q y_1y_2 = 0$. Next, subtract the first of the above equations from the second: $(y_1y_2'' - y_2y_1'') + P(y_1y_2' - y_2y_1') = 0$. We recognize the last equation as $\frac{dW}{dx} + PW = 0$. This is a first-order linear equation and its general solution is $W e^{\int Pdx} = C$ or $W = Ce^{-\int Pdx}$. The exponential function is never zero. Thus $W$ is identically zero if $C=0$ and is never zero if $C \neq 0$. Thus we have proved that the Wronskian $W = W(y_1, y_2)$ is either identically zero or never zero. ##### Lemma 2 If $y_1(x)$ and $y_2(x)$ are any two solutions of the equation $y'' + P(x)y' + Q(x)y = 0$ on the interval $[a, b]$, then they are linearly dependent on this interval if and only if their Wronskian $W(y_1, y_2) = 0$ is identically zero on $[a, b]$. **Proof:** Suppose $y_1$ and $y_2$ are linearly dependent. We must prove that $W(y_1, y_2) = y_1y_2' - y_2y_1' = 0$ on $[a, b]$. If either $y_1$ or $y_2$ is identically zero on $[a, b]$, then $W(y_1, y_2) = 0$. Otherwise, since $y_1$ and $y_2$ are linearly dependent, each is a constant multiple of the other. So, $y_2 = cy_1$ for some constant $c$ and hence $y_2' = cy_1'$. Hence $W(y_1, y_2) = y_1y_2' - y_2y_1' = y_1(cy_1') - (cy_1)y_1' = cy_1y_1' - cy_1y_1' = 0$. This proves one direction of the lemma. **Converse:** Suppose that the Wronskian $W(y_1, y_2)$ is identically zero on $[a, b]$. We must prove that the solutions are linearly dependent. If $y_1$ is identically zero on $[a, b]$, it is obvious that $y_1$ and $y_2$ are linearly dependent. So, let us suppose that $y_1$ is not identically zero on $[a, b]$. Then the continuity of $y_1$ on $[a, b]$ implies that $y_1$ is never zero on some interval $[c, d] \subseteq [a, b]$. Also the Wronskian is identically zero on $[a, b]$. So, on the interval $[c, d] \subseteq [a, b]$, we have $$ \frac{y_1y_2' - y_2y_1'}{y_1^2} = 0 \quad \text{or} \quad \left(\frac{y_2}{y_1}\right)' = 0 $$ Thus, on the interval $[c, d]$, we have $\frac{y_2}{y_1} = k$ or $y_2 = ky_1$ for some constant $k$. This means that, on the interval $[c, d]$, we also have $y_2' = ky_1'$. Thus we have that the solutions $y_2$ and $ky_1$ and their derivatives agree at some point in $[a, b]$. Therefore, by the existence and uniqueness theorem for second-order linear equations, it follows that $y_2 = ky_1$ on the entire interval $[a, b]$. Thus we have proved that $y_1$ and $y_2$ are linearly dependent on $[a, b]$. #### Summary ##### Lemma If $y_1(x)$ and $y_2(x)$ are any two solutions of the homogeneous linear equation $y'' + P(x)y' + Q(x)y = 0$ on the interval $[a, b]$, then their Wronskian $W(y_1, y_2)$ is either identically zero or never zero on $[a, b]$. ##### Lemma If $y_1(x)$ and $y_2(x)$ are any two solutions of the equation $y'' + P(x)y' + Q(x)y = 0$ on the interval $[a, b]$, then they are linearly dependent on this interval if and only if their Wronskian $W(y_1, y_2) = 0$ is identically zero on $[a, b]$. **Conclusion:** $y_1$ and $y_2$ are linearly independent solutions of the differential equation if and only if their Wronskian is never zero on $[a, b]$. Hence if $y(x)$ is any solution of the equation, then the system below has a unique solution $c_1$ and $c_2$ for every choice of $x_0$ from $[a, b]$: $$ c_1y_1(x_0) + c_2y_2(x_0) = y(x_0) $$ $$ c_1y_1'(x_0) + c_2y_2'(x_0) = y'(x_0) $$ #### Theorem Let $P(x)$ and $Q(x)$ be continuous functions on the interval $[a, b]$. Let $y_1(x)$ and $y_2(x)$ be linearly independent solutions of the homogeneous equation $y'' + P(x)y' + Q(x)y = 0$ on the interval $[a, b]$. Then $c_1y_1(x) + c_2y_2(x)$ is the general solution of the differential equation on $[a, b]$. #### Example Show that $y = c_1 \sin x + c_2 \cos x$ is the general solution of $y'' + y = 0$ on any interval. Also find the particular solution for which $y(0) = 2$ and $y'(0) = 3$. **Solution:** By substitution, we see that $y_1 = \sin x$ and $y_2 = \cos x$ are solutions of the given differential equation. Also they are linearly independent since $y_1/y_2 = \tan x$ is not a constant or since their Wronskian is never zero: $$ W(y_1, y_2) = \begin{vmatrix} \sin x & \cos x \\ \cos x & -\sin x \end{vmatrix} = -\sin^2 x - \cos^2 x = -1 $$ Thus $y = c_1 \sin x + c_2 \cos x$ is the general solution on any interval $[a, b]$. Now, $y(0) = 2$ implies that $c_1 \sin 0 + c_2 \cos 0 = 2$ or $c_2 = 2$. And $y'(0) = 3$ implies that $c_1 \cos 0 - c_2 \sin 0 = 3$ or $c_1 = 3$. Thus $y = 3 \sin x + 2 \cos x$ is the required particular solution. #### Homework 1. Show that $e^x$ and $e^{-x}$ are linearly independent solutions of $y'' - y = 0$ on any interval. 2. Show that $y = c_1x + c_2x^2$ is the general solution of $x^2y'' - 2xy' + 2y = 0$ on any interval not containing $0$. Also find the particular solution for which $y(1) = 3$ and $y'(1) = 5$. 3. Show that $y = c_1e^x + c_2e^{2x}$ is the general solution of $y'' - 3y' + 2y = 0$ on any interval. Also find the particular solution for which $y(0) = -1$ and $y'(0) = 1$. 4. Show that $y = c_1e^{2x} + c_2xe^{2x}$ is the general solution of $y'' - 4y' + 4y = 0$ on any interval. ### The Use of a Known Solution to Find Another Let $y_1(x)$ be a solution of $y'' + P(x)y' + Q(x)y = 0$. Then we know that $y_2 = cy_1$ is also a solution of the equation. But in this case $y_1$ and $y_2$ are linearly dependent. So, instead we try to find a non-constant function $v(x)$ such that $y_2 = vy_1$ is also a solution. In this case, $y_2/y_1 = v$ is not a constant and hence $y_1$ and $y_2$ are linearly independent. Now, $y_2 = vy_1$ is a solution of the equation implies that $y_2'' + P(x)y_2' + Q(x)y_2 = 0$. We now compute $y_2'$ and $y_2''$ from $y_2 = vy_1$: $y_2' = v'y_1 + vy_1'$ and $y_2'' = v''y_1 + v'y_1' + v'y_1' + vy_1'' = v''y_1 + 2v'y_1' + vy_1''$. On substituting these into the differential equation, we obtain $(v''y_1 + 2v'y_1' + vy_1'') + P(v'y_1 + vy_1') + Q(vy_1) = 0$ or $v(y_1'' + Py_1' + Qy_1) + v''y_1 + v'(2y_1' + Py_1) = 0$. But $y_1$ is a solution of the differential equation. So, the above equation implies: $v''y_1 + v'(2y_1' + Py_1) = 0$. Thus we have $v''y_1 + v'(2y_1' + Py_1) = 0$ or $$ \frac{v''}{v'} = -2\frac{y_1'}{y_1} - P $$ Integrating the above gives $$ \log v' = -2 \log y_1 - \int Pdx $$ or $$ v' = \frac{1}{y_1^2} e^{-\int Pdx} $$ So, we have $$ v = \int \frac{1}{y_1^2} e^{-\int Pdx} dx $$ #### Example Solve $x^2y'' + xy' - y = 0$. **Solution:** By inspection, we discover that $y_1 = x$ is a solution of the differential equation. We must find another solution $y_2$ that is linearly independent of $y_1$. We begin by writing the differential equation in the standard form: $$ y'' + \frac{1}{x}y' - \frac{1}{x^2}y = 0 $$ Here $P = \frac{1}{x}$. Hence $y_2 = vy_1$ is a second linearly independent solution of the equation, where $$ v = \int \frac{1}{y_1^2} e^{-\int Pdx} dx = \int \frac{1}{x^2} e^{-\int (1/x)dx} dx = \int \frac{1}{x^2} e^{-\log x} dx = \int x^{-3} dx = \frac{x^{-2}}{-2} $$ Thus we have $y_2 = vy_1 = \frac{x^{-2}}{-2} \cdot x = (-\frac{1}{2})x^{-1}$. Hence the general solution is $y = c_1x + c_2x^{-1}$. #### Homework 1. Use the method of this section to find $y_2$ and the general solution for each of the following equations from the given solution $y_1$: (a) $y'' + y = 0$, $y_1 = \sin x$; (b) $y'' - y = 0$, $y_1 = e^x$. 2. The equation $xy'' + 3y' = 0$ has the obvious solution $y_1 = 1$. Find $y_2$ and the general solution. 3. Verify that $y_1 = x^2$ is one solution of $x^2y'' + xy' - 4y = 0$, and find $y_2$ and the general solution. 4. The equation $(1 - x^2)y'' - 2xy' + 2y = 0$ has $y_1 = x$ as an obvious solution. Find the general solution. ### The Homogeneous Equation With Constant Coefficients We now consider homogeneous equations $y'' + P(x)y' + Q(x)y = 0$ in which $P(x)$ and $Q(x)$ are constants $p$ and $q$: $y'' + py' + qy = 0$. And we look for solutions of the form $y = e^{mx}$. Note that $y = e^{mx} \implies y' = me^{mx}$ and $y'' = m^2e^{mx}$. Thus substituting $y = e^{mx}$ in the equation $y'' + py' + qy = 0$ gives $m^2e^{mx} + pme^{mx} + qe^{mx} = 0$ or $(m^2 + pm + q)e^{mx} = 0$. But $e^{mx}$ is never zero. Thus the LHS of the above equation is zero if and only if $m^2 + pm + q = 0$. Hence $y = e^{mx}$ is a solution of $y'' + py' + qy = 0$ if and only if $m^2 + pm + q = 0$. #### Theorem The homogeneous equation $y'' + py' + qy = 0$ has $y = e^{mx}$ as a solution if and only if $m$ is a root of the auxiliary equation $m^2 + pm + q = 0$. #### The Roots of a Quadratic Equation The quadratic equation $m^2 + pm + q = 0$ has roots $$ m_{1,2} = \frac{-p \pm \sqrt{p^2 - 4q}}{2} $$ The roots could be real and distinct or real and equal or purely complex, depending on the sign of the discriminant $p^2 - 4q$. #### Case 1: The Auxiliary Equation Has Two Distinct Real Roots This is the case if and only if $p^2 - 4q > 0$. Let $m_1$ and $m_2$ be the distinct real roots of the auxiliary equation. Then $e^{m_1x}$ and $e^{m_2x}$ are two solutions of the differential equation. Also $$ \frac{e^{m_1x}}{e^{m_2x}} = e^{(m_1-m_2)x} $$ is not a constant. Thus the solutions $e^{m_1x}$ and $e^{m_2x}$ are linearly independent and $y = c_1e^{m_1x} + c_2e^{m_2x}$ is the general solution of the differential equation. ##### Example Solve $y'' + y' - 6y = 0$. **Solution:** The auxiliary equation of the given differential equation is $m^2 + m - 6 = 0$. It has two distinct real roots, namely $m_1 = -3$ and $m_2 = 2$. Thus the general solution of the given differential equation is $y = c_1e^{-3x} + c_2e^{2x}$, where $c_1$ and $c_2$ are arbitrary constants. #### Case 2: The Auxiliary Equation Has Two Distinct Complex Roots This is the case if and only if $p^2 - 4q ### The Method of Undetermined Coefficients We now take up the task of finding a particular solution $y_p(x)$ of the non-homogeneous equation: $y'' + P(x)y' + Q(x)y = R(x)$. The first method we are going to learn is called "The Method of Undetermined Coefficients." This method is applicable for equations of the form $y'' + py' + qy = R(x)$, where $p$ and $q$ are constants and $R(x)$ is an exponential, a sine or cosine, a polynomial or some combination of such functions. #### Equations of the Form $y'' + py' + qy = e^{ax}$ In this case, substituting $y = e^{ax}$ on the LHS of the equation gives a constant multiple of $e^{ax}$. So, we guess that the equation perhaps has a particular solution $y_p = Ae^{ax}$ for some constant $A$. Here $A$ is the undetermined coefficient that we want to determine in such a way that it is actually a solution of the differential equation. On substituting $y_p = Ae^{ax}$ into $y'' + py' + qy = e^{ax}$, we get $A(a^2 + pa + q)e^{ax} = e^{ax}$ so that $$ A = \frac{1}{a^2 + pa + q} $$ This choice of $A$ will make $y_p = Ae^{ax}$ a solution of the differential equation provided $a^2 + pa + q \neq 0$. [$a^2 + pa + q = 0$ means that $a$ is a root of the auxiliary equation $m^2 + pm + q = 0$. So, there cannot be a particular solution of the form $Ae^{ax}$.] In this case, try a particular solution of the form $y_p = Axe^{ax}$. This indeed works if $a$ is not a double root of the auxiliary equation. If $a$ is a double root of the auxiliary equation, then the nonhomogeneous equation has a particular solution of the form $y_p = Ax^2e^{ax}$. ##### Summary **Goal:** To find a particular solution of the equation of the form $y'' + py' + qy = e^{ax}$. * If $a$ is not a root of the auxiliary equation $m^2 + pm + q = 0$, then the nonhomogeneous equation has a particular solution of the form $Ae^{ax}$. * If $a$ is a simple root of the auxiliary equation, then the nonhomogeneous equation has a particular solution of the form $Axe^{ax}$. * If $a$ is a double root of the auxiliary equation, then the nonhomogeneous equation has a particular solution of the form $Ax^2e^{ax}$. In each case, we substitute the respective $y_p(x)$ in the nonhomogeneous equation and determine the coefficient $A$. #### Equations of the Form $y'' + py' + qy = \sin bx$ The derivatives of $\sin bx$ are constant multiples of $\sin bx$ and $\cos bx$. So, we take a trial solution of the form $y_p = A \sin bx + B \cos bx$. The undetermined coefficients $A$ and $B$ are now determined by substituting this trial $y_p$ into the nonhomogeneous differential equation and equating the resulting coefficients of $\sin bx$ and $\cos bx$ on the left and right. **Note:** This approach works when $R(x)$ on the RHS is $\cos bx$ or any linear combination $\alpha \sin bx + \beta \cos bx$. This method breaks down if $A \sin bx + B \cos bx$ satisfies the reduced homogeneous equation $y'' + py' + qy = 0$. In this case, the differential equation has a particular solution of the form $y_p = x(A \sin bx + B \cos bx)$. ##### Example Find a particular solution of $y'' + y = \sin x$. **Solution:** The reduced homogeneous equation $y'' + y = 0$ has $y = c_1 \sin x + c_2 \cos x$ as a particular solution. So, it is useless to take $y_p = A \sin x + B \cos x$ as a trial solution. So, we try $y_p = x(A \sin x + B \cos x)$. This gives $y_p' = A \sin x + B \cos x + x(A \cos x - B \sin x)$ and $y_p'' = 2A \cos x - 2B \sin x + x(-A \sin x - B \cos x)$. Substituting these in $y'' + y = \sin x$ gives $2A \cos x - 2B \sin x = \sin x$. This implies that $A=0$ and $B = -\frac{1}{2}$. Thus the particular solution is $y_p = -\frac{1}{2}x \cos x$. #### Equations of the Form $y'' + py' + qy = a_0 + a_1x + a_2x^2 + \dots + a_nx^n$ In this case, we seek a particular solution of the form $y_p = A_0 + A_1x + A_2x^2 + \dots + A_nx^n$. We substitute this $y_p$ into the differential equation and equate the like powers of $x$ to determine the undetermined coefficients $A_0, A_1, \dots, A_n$. If $q=0$, then this procedure gives $x^{n-1}$ as the highest power of $x$ on the left. So, in this case, we take $y_p = x(A_0 + A_1x + A_2x^2 + \dots + A_nx^n) = A_0x + A_1x^2 + A_2x^3 + \dots + A_nx^{n+1}$. If both $p$ and $q$ are zero, then the equation can be solved by direct integration. ##### Example Find the general solution of $y'' - y' - 2y = 4x^2$. **Solution:** Here the reduced homogeneous equation is $y'' - y' - 2y = 0$. Its auxiliary equation is $m^2 - m - 2 = 0$ or $(m-2)(m+1) = 0$. So, its roots are $m_1 = -1$ and $m_2 = 2$. Thus the general solution of the auxiliary equation is $y_g = c_1e^{-x} + c_2e^{2x}$. The RHS of the differential equation is a polynomial of the second degree. So, we take a trial solution of the form $y_p = A + Bx + Cx^2$ and substitute it in the differential equation: $2C - (B + 2Cx) - 2(A + Bx + Cx^2) = 4x^2$. Equating the coefficients of like powers of $x$ gives $2C - B - 2A = 0$ $-2C - 2B = 0$ $-2C = 4$ Solving this linear system gives $C = -2, B = 2$ and $A = -3$. Hence a particular solution of the given nonhomogeneous is $y_p = -3 + 2x - 2x^2$. And hence its general solution is $y = c_1e^{-x} + c_2e^{2x} - 3 + 2x - 2x^2$. #### Homework Find the general solution of each of the following equations: 1. $y'' + 3y' - 10y = 6e^{4x}$ 2. $y'' + 4y = 3 \sin x$ 3. $y'' + 10y' + 25y = 14e^{-5x}$ 4. $y'' - 2y' + 5y = 25x^2 + 12$ 5. $y'' - y' - 6y = 20e^{-2x}$ 6. $y'' - 3y' + 2y = 14 \sin 2x - 18 \cos 2x$ ### The Principle of Superposition If $y_1(x)$ and $y_2(x)$ are solutions of $y'' + P(x)y' + Q(x)y = R_1(x)$ and $y'' + P(x)y' + Q(x)y = R_2(x)$, respectively, then $y(x) = y_1(x) + y_2(x)$ is a solution of $y'' + P(x)y' + Q(x)y = R_1(x) + R_2(x)$. This principle enables us to apply the method of undetermined coefficients to nonhomogeneous equations in which $R(x)$ is a sum of exponential, sine, cosine, and/or polynomial functions. #### Homework Use the principle of superposition to find the general solution of 1. $y'' + 4y = 4 \cos 2x + 6 \cos x + 8x^2 - 4x$ 2. $y'' + 9y = 2 \sin 3x + 4 \sin x - 26e^{-2x} + 27x^3$ ### The Method Of Variation of Parameters **Goal:** To find a particular solution $y_p(x)$ of the non-homogeneous equation: $y'' + P(x)y' + Q(x)y = R(x)$. **Note:** The Method of Undetermined Coefficients does not solve this problem in general: This method is applicable only for equations of the form $y'' + py' + qy = R(x)$, where $p$ and $q$ are constants and $R(x)$ is an exponential, a sine or cosine, a polynomial or some combination of such functions. But The Method Of Variation of Parameters is much more powerful and works almost always! This method always works, regardless of the nature of $P(x)$, $Q(x)$, $R(x)$, provided a general solution of the corresponding homogeneous equation $y'' + P(x)y' + Q(x)y = 0$ is already known. **Idea:** Suppose we have found the general solution of $y'' + P(x)y' + Q(x)y = 0$: $y = c_1y_1(x) + c_2y_2(x)$. We replace the constants $c_1$ and $c_2$ by two unknown functions $v_1(x)$ and $v_2(x)$. Subsequently, we determine $v_1(x)$ and $v_2(x)$ so that $y = v_1y_1 + v_2y_2$ is a solution of the complete equation $y'' + P(x)y' + Q(x)y = R(x)$. #### Finding $v_1(x)$ and $v_2(x)$ **Idea:** Obtain two equations relating $v_1(x)$ and $v_2(x)$ and solve them for $v_1(x)$ and $v_2(x)$. How do we get them? If $y = v_1y_1 + v_2y_2$ is a solution of the non-homogeneous equation, then it must satisfy the equation. So, we can synthesize one equation by substituting $y = v_1y_1 + v_2y_2$ in the equation. We get another equation by imposing one more condition on $v_1$ and $v_2$. #### Finding $v_1(x)$ and $v_2(x)$: The Details Differentiating $y = v_1y_1 + v_2y_2$ gives $y' = v_1y_1' + v_1'y_1 + v_2y_2' + v_2'y_2 = (v_1y_1' + v_2y_2') + (v_1'y_1 + v_2'y_2)$. Hence computing $y''$ will introduce the second-order derivatives of the unknown functions $v_1$ and $v_2$. And it is not desirable. We avoid this by requiring that $v_1'y_1 + v_2'y_2 = 0$. Interestingly, this becomes one of the two equations we are looking for! Thus we have $y' = v_1y_1' + v_2y_2'$. So, $y'' = v_1y_1'' + v_1'y_1' + v_2y_2'' + v_2'y_2'$. We also have $y = v_1y_1 + v_2y_2$. We now substitute all these into $y'' + P(x)y' + Q(x)y = R(x)$ to get another equation: $(v_1y_1'' + v_1'y_1' + v_2y_2'' + v_2'y_2') + P(x)(v_1y_1' + v_2y_2') + Q(x)(v_1y_1 + v_2y_2) = R(x)$ or $v_1(y_1'' + P(x)y_1' + Q(x)y_1) + v_2(y_2'' + P(x)y_2' + Q(x)y_2) + v_1'y_1' + v_2'y_2' = R(x)$. But $y_1$ and $y_2$ are solutions of the homogeneous equation $y'' + P(x)y' + Q(x)y = 0$. So, the above equation becomes $v_1'y_1' + v_2'y_2' = R(x)$. Thus we have the following two linear equations in the two unknown functions $v_1'$ and $v_2'$: $v_1'y_1 + v_2'y_2 = 0$ $v_1'y_1' + v_2'y_2' = R(x)$ The above equations give $v_1'(y_1y_2' - y_2y_1') = -y_2R(x)$ and $v_2'(y_1y_2' - y_2y_1') = y_1R(x)$. From this, we get $$ v_1' = \frac{-y_2R(x)}{W(y_1, y_2)} \quad \text{and} \quad v_2' = \frac{y_1R(x)}{W(y_1, y_2)} $$ Integration now gives $$ v_1 = \int \frac{-y_2R(x)}{W(y_1, y_2)} dx \quad \text{and} \quad v_2 = \int \frac{y_1R(x)}{W(y_1, y_2)} dx $$ Hence the particular solution $y = v_1y_1 + v_2y_2$ we are after is $$ y = y_1 \int \frac{-y_2R(x)}{W(y_1, y_2)} dx + y_2 \int \frac{y_1R(x)}{W(y_1, y_2)} dx $$ **Note:** This method will be successful only if the above integrals can be found. And a general solution for the associated homogeneous equation is available. #### Example Find a particular solution of $y'' + y = \csc x$. **Solution:** The associated homogeneous equation $y'' + y = 0$ has the general solution $y(x) = c_1 \sin x + c_2 \cos x$. So, we have $y_1 = \sin x$ and $y_2 = \cos x$; hence $y_1' = \cos x$ and $y_2' = -\sin x$. Thus the Wronskian of $y_1$ and $y_2$ is $W(y_1, y_2) = y_1y_2' - y_2y_1' = \sin x(-\sin x) - \cos x(\cos x) = -\sin^2 x - \cos^2 x = -1$. And $$ v_1 = \int \frac{-y_2R(x)}{W(y_1, y_2)} dx = \int \frac{-\cos x \csc x}{-1} dx = \int \frac{-\cos x/\sin x}{-1} dx = \int \frac{\cos x}{\sin x} dx = \log(\sin x) $$ $$ v_2 = \int \frac{y_1R(x)}{W(y_1, y_2)} dx = \int \frac{\sin x \csc x}{-1} dx = \int \frac{1}{-1} dx = -x $$ Hence the desired particular solution is $y_p = \sin x \log(\sin x) - x \cos x$. #### Homework Find a particular solution of each of the following equations: 1. $y'' - 2y' + y = 2x$. 2. $y'' - y' - 6y = e^{-x}$. 3. $y'' + 4y = \tan 2x$. 4. $y'' + 2y' + 5y = e^{-x} \sec 2x$. 5. $y'' + 2y' + y = e^x \log x$. 6. $y'' - 3y' + 2y = (1 + e^{-x})^{-1}$.