maths.free › Differential Equations › 7. Second-Order Differential Equations › Nonhomogeneous Linear Equations
Nonhomogeneous Linear Equations
Write the general solution to a nonhomogeneous differential equation.
Write the general solution to a nonhomogeneous differential equation.
General Solution to a Nonhomogeneous Linear Equation
Consider the nonhomogeneous linear differential equation
\[{a}_{2}(x){y}^{″}+{a}_{1}(x){y}^{'}+{a}_{0}(x)y=r(x).\]The associated homogeneous equation
\[{a}_{2}(x){y}^{″}+{a}_{1}(x){y}^{'}+{a}_{0}(x)y=0\]is called the complementary equation. We will see that solving the complementary equation is an important step in solving a nonhomogeneous differential equation.
Condensed — the full section is in OpenStax Calculus Volume 3.
Undetermined Coefficients
The method of undetermined coefficients involves making educated guesses about the form of the particular solution based on the form of \(r(x\text{).}\) When we take derivatives of polynomials, exponential functions, sines, and cosines, we get polynomials, exponential functions, sines, and cosines. So when \(r(x)\) has one of these forms, it is possible that the solution to the nonhomogeneous differential equation might take that same form. Let’s look at some examples to see how this works.
Example
Try it.
Find the general solution to \({y}^{″}+4{y}^{'}+3y=3x\text{.}\)
Solution
The complementary equation is \({y}^{″}+4{y}^{'}+3y=0,\) with general solution \({c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{-3x}.\) Since \(r(x)=3x,\) the particular solution might have the form \({y}_{p}(x)=Ax+B\text{.}\) If this is the case, then we have \({y}_{p}{}^{'}(x)=A\) and \({y}_{p}\text{″}(x)=0.\) For \({y}_{p}\) to be a solution to the differential equation, we must find values for \(A\) and \(B\) such that
\[\begin{array}{lll}{y}^{″}+4{y}^{'}+3y & = & 3x \\ 0+4(A)+3(Ax+B) & = & 3x \\ 3Ax+(4A+3B) & = & 3x\text{.}\end{array}\]Setting coefficients of like terms equal, we have
\[\begin{array}{lll}3A & = & 3 \\ 4A+3B & = & 0.\end{array}\]Then, \(A=1\) and \(B=-\frac{4}{3},\) so \({y}_{p}(x)=x-\frac{4}{3}\) and the general solution is
\[y(x)={c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{-3x}+x-\frac{4}{3}.\]In , notice that even though \(r(x)\) did not include a constant term, it was necessary for us to include the constant term in our guess. If we had assumed a solution of the form \({y}_{p}=Ax\) (with no constant term), we would not have been able to find a solution. (Verify this!) If the function \(r(x)\) is a polynomial, our guess for the particular solution should be a polynomial of the same degree, and it must include all lower-order terms, regardless of whether they are present in \(r(x\text{).}\)
Example
Try it.
Find the general solution to \({y}^{″}-{y}^{'}-2y=2{e}^{3x}.\)
Solution
The complementary equation is \({y}^{″}-{y}^{'}-2y=0,\) with the general solution \({c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{2x}.\) Since \(r(x)=2{e}^{3x},\) the particular solution might have the form \({y}_{p}(x)=A{e}^{3x}.\) Then, we have \({y}_{p}{}^{'}(x)=3A{e}^{3x}\) and \({y}_{p}\text{″}(x)=9A{e}^{3x}.\) For \({y}_{p}\) to be a solution to the differential equation, we must find a value for \(A\) such that
\[\begin{array}{lll}{y}^{″}-{y}^{'}-2y & = & 2{e}^{3x} \\ 9A{e}^{3x}-3A{e}^{3x}-2A{e}^{3x} & = & 2{e}^{3x} \\ 4A{e}^{3x} & = & 2{e}^{3x}.\end{array}\]So, \(4A=2\) and \(A=1\text{/}2.\) Then, \({y}_{p}(x)=(\frac{1}{2}){e}^{3x},\) and the general solution is
\[y(x)={c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{2x}+\frac{1}{2}{e}^{3x}.\]and
Condensed — the full section is in OpenStax Calculus Volume 3.
Variation of Parameters
Sometimes, \(r(x)\) is not a combination of polynomials, exponentials, or sines and cosines. When this is the case, the method of undetermined coefficients does not work, and we have to use another approach to find a particular solution to the differential equation. We use an approach called the method of variation of parameters.
To simplify our calculations a little, we are going to divide the differential equation through by \(a,\) so we have a leading coefficient of 1. Then the differential equation has the form
\[{y}^{″}+p{y}^{'}+qy=r(x),\]where \(p\) and \(q\) are constants.
If the general solution to the complementary equation is given by \({c}_{1}{y}_{1}(x)+{c}_{2}{y}_{2}(x),\) we are going to look for a particular solution of the form \({y}_{p}(x)=u(x){y}_{1}(x)+v(x){y}_{2}(x\text{).}\) In this case, we use the two linearly independent solutions to the complementary equation to form our particular solution. However, we are assuming the coefficients are functions of x, rather than constants. We want to find functions \(u(x)\) and \(v(x)\) such that \({y}_{p}(x)\) satisfies the differential equation. We have
\[\begin{array}{lll}{y}_{p} & = & u{y}_{1}+v{y}_{2} \\ {y}_{p}{}^{'} & = & {u}^{'}{y}_{1}+u{y}_{1}{}^{'}+{v}^{'}{y}_{2}+v{y}_{2}{}^{'} \\ {y}_{p}\text{″} & = & {({u}^{'}{y}_{1}+{v}^{'}{y}_{2})}^{'}+{u}^{'}{y}_{1}{}^{'}+u{y}_{1}\text{″}+{v}^{'}{y}_{2}{}^{'}+v{y}_{2}\text{″}\text{.}\end{array}\]Substituting into the differential equation, we obtain
\[\begin{array}{ll}{y}_{p}\text{″}+p{y}_{p}{}^{'}+q{y}_{p} & =[{({u}^{'}{y}_{1}+{v}^{'}{y}_{2})}^{'}+{u}^{'}{y}_{1}{}^{'}+u{y}_{1}\text{″}+{v}^{'}{y}_{2}{}^{'}+v{y}_{2}\text{″}] \\ & \ +p[{u}^{'}{y}_{1}+u{y}_{1}{}^{'}+{v}^{'}{y}_{2}+v{y}_{2}{}^{'}]+q[u{y}_{1}+v{y}_{2}] \\ & =u[{y}_{1}\text{″}+p{y}_{1}{}^{'}+q{y}_{1}]+v[{y}_{2}\text{″}+p{y}_{2}{}^{'}+q{y}_{2}] \\ & \ +{({u}^{'}{y}_{1}+{v}^{'}{y}_{2})}^{'}+p({u}^{'}{y}_{1}+{v}^{'}{y}_{2})+({u}^{'}{y}_{1}{}^{'}+{v}^{'}{y}_{2}{}^{'}).\end{array}\]Note that \({y}_{1}\) and \({y}_{2}\) are solutions to the complementary equation, so the first two terms are zero. Thus, we have
\[{({u}^{'}{y}_{1}+{v}^{'}{y}_{2})}^{'}+p({u}^{'}{y}_{1}+{v}^{'}{y}_{2})+({u}^{'}{y}_{1}{}^{'}+{v}^{'}{y}_{2}{}^{'})=r(x\text{).}\]If we simplify this equation by imposing the additional condition \({u}^{'}{y}_{1}+{v}^{'}{y}_{2}=0,\) the first two terms are zero, and this reduces to \({u}^{'}{y}_{1}{}^{'}+{v}^{'}{y}_{2}{}^{'}=r(x\text{).}\) So, with this additional condition, we have a system of two equations in two unknowns:
\[\begin{array}{lll}{u}^{'}{y}_{1}+{v}^{'}{y}_{2} & = & 0 \\ {u}^{'}{y}_{1}{}^{'}+{v}^{'}{y}_{2}{}^{'} & = & r(x\text{).}\end{array}\]Condensed — the full section is in OpenStax Calculus Volume 3.
Key Concepts
- To solve a nonhomogeneous linear second-order differential equation, first find the general solution to the complementary equation, then find a particular solution to the nonhomogeneous equation.
- Let \({y}_{p}(x)\) be any particular solution to the nonhomogeneous linear differential equation
\[{a}_{2}(x){y}^{″}+{a}_{1}(x){y}^{'}+{a}_{0}(x)y=r(x),\]
and let \({c}_{1}{y}_{1}(x)+{c}_{2}{y}_{2}(x)\) denote the general solution to the complementary equation. Then, the general solution to the nonhomogeneous equation is given by
\[y(x)={c}_{1}{y}_{1}(x)+{c}_{2}{y}_{2}(x)+{y}_{p}(x\text{).}\] - When \(r(x)\) is a combination of polynomials, exponential functions, sines, and cosines, use the method of undetermined coefficients to find the particular solution. To use this method, assume a solution in the same form as \(r(x),\) multiplying by x as necessary until the assumed solution is linearly independent of the general solution to the complementary equation. Then, substitute the assumed solution into the differential equation to find values for the coefficients.
- When \(r(x)\) is not a combination of polynomials, exponential functions, or sines and cosines, use the method of variation of parameters to find the particular solution. This method involves using Cramer’s rule or another suitable technique to find functions \({u}^{'}(x)\) and \({v}^{'}(x)\) satisfying
\[\begin{array}{lll}{u}^{'}{y}_{1}+{v}^{'}{y}_{2} & = & 0 \\ {u}^{'}{y}_{1}{}^{'}+{v}^{'}{y}_{2}{}^{'} & = & r(x\text{).}\end{array}\]
Then, \({y}_{p}(x)=u(x){y}_{1}(x)+v(x){y}_{2}(x)\) is a particular solution to the differential equation.
Key Equations
| Complementary equation | \({a}_{2}(x){y}^{″}+{a}_{1}(x){y}^{'}+{a}_{0}(x)y=0\) |
| General solution to a nonhomogeneous linear differential equation | \(y(x)={c}_{1}{y}_{1}(x)+{c}_{2}{y}_{2}(x)+{y}_{p}(x)\) |
Nonhomogeneous Linear Equations
Solve the following equations using the method of undetermined coefficients.
In each of the following problems,
- Write the form for the particular solution \({y}_{p}(x)\) for the method of undetermined coefficients.
- [T] Use a computer algebra system to find a particular solution to the given equation.
Solve the differential equation using either the method of undetermined coefficients or the variation of parameters.
Solve the differential equation using the method of variation of parameters.
Find the unique solution satisfying the differential equation and the initial conditions given, where \({y}_{p}(x)\) is the particular solution.
In each of the following problems, two linearly independent solutions—\({y}_{1}\) and \({y}_{2}\)—are given that satisfy the corresponding homogeneous equation. Use the method of variation of parameters to find a particular solution to the given nonhomogeneous equation. Assume x > 0 in each exercise.
Practice (40)
Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.
-
Given that \({y}_{p}(x)=x\) is a particular solution to the differential equation \({y}^{″}+y=x,\) write the general solution and check by verifying that the solution satisfies the equation.
Sýna svarið
The complementary equation is \({y}^{″}+y=0,\) which has the general solution \({c}_{1}\text{cos}\ x+{c}_{2}\text{sin}\ x\text{.}\) So, the general solution to the nonhomogeneous equation is
\[y(x)={c}_{1}\text{cos}\ x+{c}_{2}\text{sin}\ x+x\text{.}\]To verify that this is a solution, substitute it into the differential equation. We have
\[{y}^{'}(x)=\text{-}{c}_{1}\text{sin}\ x+{c}_{2}\text{cos}\ x+1\ \text{and}\ {y}^{″}(x)=\text{-}{c}_{1}\text{cos}\ x-{c}_{2}\text{sin}\ x\text{.}\]Then
\[\begin{array}{ll}{y}^{″}(x)+y(x) & =\text{-}{c}_{1}\text{cos}\ x-{c}_{2}\text{sin}\ x+{c}_{1}\text{cos}\ x+{c}_{2}\text{sin}\ x+x \\ & =x\text{.}\end{array}\]So, \(y(x)\) is a solution to \({y}^{″}+y=x\text{.}\)
-
Given that \({y}_{p}(x)=-2\) is a particular solution to \({y}^{″}-3{y}^{'}-4y=8,\) write the general solution and verify that the general solution satisfies the equation.
Sýna svarið
\(y(x)={c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{4x}-2\)
-
Find the general solution to \({y}^{″}+4{y}^{'}+3y=3x\text{.}\)
Sýna svarið
The complementary equation is \({y}^{″}+4{y}^{'}+3y=0,\) with general solution \({c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{-3x}.\) Since \(r(x)=3x,\) the particular solution might have the form \({y}_{p}(x)=Ax+B\text{.}\) If this is the case, then we have \({y}_{p}{}^{'}(x)=A\) and \({y}_{p}\text{″}(x)=0.\) For \({y}_{p}\) to be a solution to the differential equation, we must find values for \(A\) and \(B\) such that
\[\begin{array}{lll}{y}^{″}+4{y}^{'}+3y & = & 3x \\ 0+4(A)+3(Ax+B) & = & 3x \\ 3Ax+(4A+3B) & = & 3x\text{.}\end{array}\]Setting coefficients of like terms equal, we have
\[\begin{array}{lll}3A & = & 3 \\ 4A+3B & = & 0.\end{array}\]Then, \(A=1\) and \(B=-\frac{4}{3},\) so \({y}_{p}(x)=x-\frac{4}{3}\) and the general solution is
\[y(x)={c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{-3x}+x-\frac{4}{3}.\] -
Find the general solution to \({y}^{″}-{y}^{'}-2y=2{e}^{3x}.\)
Sýna svarið
The complementary equation is \({y}^{″}-{y}^{'}-2y=0,\) with the general solution \({c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{2x}.\) Since \(r(x)=2{e}^{3x},\) the particular solution might have the form \({y}_{p}(x)=A{e}^{3x}.\) Then, we have \({y}_{p}{}^{'}(x)=3A{e}^{3x}\) and \({y}_{p}\text{″}(x)=9A{e}^{3x}.\) For \({y}_{p}\) to be a solution to the differential equation, we must find a value for \(A\) such that
\[\begin{array}{lll}{y}^{″}-{y}^{'}-2y & = & 2{e}^{3x} \\ 9A{e}^{3x}-3A{e}^{3x}-2A{e}^{3x} & = & 2{e}^{3x} \\ 4A{e}^{3x} & = & 2{e}^{3x}.\end{array}\]So, \(4A=2\) and \(A=1\text{/}2.\) Then, \({y}_{p}(x)=(\frac{1}{2}){e}^{3x},\) and the general solution is
\[y(x)={c}_{1}{e}^{\text{-}x}+{c}_{2}{e}^{2x}+\frac{1}{2}{e}^{3x}.\] -
Find the general solution to \({y}^{″}-4{y}^{'}+4y=7\ \text{sin}\ t-\text{cos}\ t\text{.}\)
Sýna svarið
\(y(t)={c}_{1}{e}^{2t}+{c}_{2}t{e}^{2t}+\text{sin}\ t+\text{cos}\ t\)
-
Find the general solutions to the following differential equations.
- \({y}^{″}-9y=-6\ \text{cos}\ 3x\)
- \({x}^{″}+2{x}^{'}+x=4{e}^{\text{-}t}\)
- \({y}^{″}-2{y}^{'}+5y=10{x}^{2}-3x-3\)
- \({y}^{″}-3{y}^{'}=-12t\)
Sýna svarið
- The complementary equation is \({y}^{″}-9y=0,\) which has the general solution \({c}_{1}{e}^{3x}+{c}_{2}{e}^{-3x}\) (step 1). Based on the form of \(r(x)=-6\ \text{cos}\ 3x,\) our initial guess for the particular solution is \({y}_{p}(x)=A\ \text{cos}\ 3x+B\ \text{sin}\ 3x\) (step 2). None of the terms in \({y}_{p}(x)\) solve the complementary equation, so this is a valid guess (step 3).
Now we want to find values for \(A\) and \(B,\) so substitute \({y}_{p}\) into the differential equation. We have
\[{y}_{p}{}^{'}(x)=-3A\ \text{sin}\ 3x+3B\ \text{cos}\ 3x\ \text{and}\ {y}_{p}\text{″}(x)=-9A\ \text{cos}\ 3x-9B\ \text{sin}\ 3x,\]
so we want to find values of \(A\) and \(B\) such that
\[\begin{array}{lll}{y}^{″}-9y & = & -6\ \text{cos}\ 3x \\ -9A\ \text{cos}\ 3x-9B\ \text{sin}\ 3x-9(A\ \text{cos}\ 3x+B\ \text{sin}\ 3x) & = & -6\ \text{cos}\ 3x \\ -18A\ \text{cos}\ 3x-18B\ \text{sin}\ 3x & = & -6\ \text{cos}\ 3x\text{.}\end{array}\]
Therefore,
\[\begin{array}{lll}-18A & = & -6 \\ -18B & = & 0.\end{array}\]
This gives \(A=\frac{1}{3}\) and \(B=0,\) so \({y}_{p}(x)=(\frac{1}{3})\ \text{cos}\ 3x\) (step 4).
Putting everything together, we have the general solution
\[y(x)={c}_{1}{e}^{3x}+{c}_{2}{e}^{-3x}+\frac{1}{3}\ \text{cos}\ 3x\text{.}\] - The complementary equation is \({x}^{″}+2{x}^{'}+x=0,\) which has the general solution \({c}_{1}{e}^{\text{-}t}+{c}_{2}t{e}^{\text{-}t}\) (step 1). Based on the form \(r(t)=4{e}^{\text{-}t},\) our initial guess for the particular solution is \({x}_{p}(t)=A{e}^{\text{-}t}\) (step 2). However, we see that this guess solves the complementary equation, so we must multiply by\(t,\) which gives a new guess: \({x}_{p}(t)=At{e}^{\text{-}t}\) (step 3). Checking this new guess, we see that it, too, solves the complementary equation, so we must multiply by t again, which gives \({x}_{p}(t)=A{t}^{2}{e}^{\text{-}t}\) (step 3 again). Now, checking this guess, we see that \({x}_{p}(t)\) does not solve the complementary equation, so this is a valid guess (step 3 yet again).
We now want to find a value for \(A,\) so we substitute \({x}_{p}\) into the differential equation. We have
\[\begin{array}{lll}{x}_{p}(t) & = & A{t}^{2}{e}^{\text{-}t},\ \text{so} \\ {x}_{p}{}^{'}(t) & = & 2At{e}^{\text{-}t}-A{t}^{2}{e}^{\text{-}t}\end{array}\]
and \({x}_{p}\text{″}(t)=2A{e}^{\text{-}t}-2At{e}^{\text{-}t}-(2At{e}^{\text{-}t}-A{t}^{2}{e}^{\text{-}t})=2A{e}^{\text{-}t}-4At{e}^{\text{-}t}+A{t}^{2}{e}^{\text{-}t}.\)
Substituting into the differential equation, we want to find a value of \(A\) so that
\[\begin{array}{lll}{x}^{″}+2{x}^{'}+x & = & 4{e}^{\text{-}t} \\ 2A{e}^{\text{-}t}-4At{e}^{\text{-}t}+A{t}^{2}{e}^{\text{-}t}+2(2At{e}^{\text{-}t}-A{t}^{2}{e}^{\text{-}t})+A{t}^{2}{e}^{\text{-}t} & = & 4{e}^{\text{-}t} \\ 2A{e}^{\text{-}t} & = & 4{e}^{\text{-}t}.\end{array}\]
This gives \(A=2,\) so \({x}_{p}(t)=2{t}^{2}{e}^{\text{-}t}\) (step 4). Putting everything together, we have the general solution
\[x(t)={c}_{1}{e}^{\text{-}t}+{c}_{2}t{e}^{\text{-}t}+2{t}^{2}{e}^{\text{-}t}.\] - The complementary equation is \({y}^{″}-2{y}^{'}+5y=0,\) which has the general solution \({c}_{1}{e}^{x}\text{cos}\ 2x+{c}_{2}{e}^{x}\text{sin}\ 2x\) (step 1). Based on the form \(r(x)=10{x}^{2}-3x-3,\) our initial guess for the particular solution is \({y}_{p}(x)=A{x}^{2}+Bx+C\) (step 2). None of the terms in \({y}_{p}(x)\) solve the complementary equation, so this is a valid guess (step 3). We now want to find values for \(A,\) \(B,\) and \(C,\) so we substitute \({y}_{p}\) into the differential equation. We have \({y}_{p}{}^{'}(x)=2Ax+B\) and \({y}_{p}\text{″}(x)=2A,\) so we want to find values of \(A,\) \(B,\) and \(C\) such that
\[\begin{array}{lll}{y}^{″}-2{y}^{'}+5y & = & 10{x}^{2}-3x-3 \\ 2A-2(2Ax+B)+5(A{x}^{2}+Bx+C) & = & 10{x}^{2}-3x-3 \\ 5A{x}^{2}+(5B-4A)x+(5C-2B+2A) & = & 10{x}^{2}-3x-3.\end{array}\]
Therefore,
\[\begin{array}{lll}5A & = & 10 \\ 5B-4A & = & -3 \\ 5C-2B+2A & = & -3.\end{array}\]
This gives \(A=2,\) \(B=1,\) and \(C=-1,\) so \({y}_{p}(x)=2{x}^{2}+x-1\) (step 4). Putting everything together, we have the general solution
\[y(x)={c}_{1}{e}^{x}\text{cos}\ 2x+{c}_{2}{e}^{x}\text{sin}\ 2x+2{x}^{2}+x-1.\] - The complementary equation is \({y}^{″}-3{y}^{'}=0,\) which has the general solution \({c}_{1}{e}^{3t}+{c}_{2}\) (step 1). Based on the form \(r(t)=-12t,\) our initial guess for the particular solution is \({y}_{p}(t)=At+B\) (step 2). However, we see that the constant term in this guess solves the complementary equation, so we must multiply by \(t,\) which gives a new guess: \({y}_{p}(t)=A{t}^{2}+Bt\) (step 3). Checking this new guess, we see that none of the terms in \({y}_{p}(t)\) solve the complementary equation, so this is a valid guess (step 3 again). We now want to find values for \(A\) and \(B,\) so we substitute \({y}_{p}\) into the differential equation. We have \({y}_{p}{}^{'}(t)=2At+B\) and \({y}_{p}\text{″}(t)=2A,\) so we want to find values of \(A\) and \(B\) such that
\[\begin{array}{lll}{y}^{″}-3{y}^{'} & = & -12t \\ 2A-3(2At+B) & = & -12t \\ -6At+(2A-3B) & = & -12t\text{.}\end{array}\]
Therefore,
\[\begin{array}{lll}-6A & = & -12 \\ 2A-3B & = & 0.\end{array}\]
This gives \(A=2\) and \(B=4\text{/}3,\) so \({y}_{p}(t)=2{t}^{2}+(4\text{/}3)t\) (step 4). Putting everything together, we have the general solution
\[y(t)={c}_{1}{e}^{3t}+{c}_{2}+2{t}^{2}+\frac{4}{3}t\text{.}\]
-
Find the general solution to the following differential equations.
- \({y}^{″}-5{y}^{'}+4y=3{e}^{x}\)
- \({y}^{″}+{y}^{'}-6y=52\ \text{cos}\ 2t\)
Sýna svarið
- \(y(x)={c}_{1}{e}^{4x}+{c}_{2}{e}^{x}-x{e}^{x}\)
- \(y(t)={c}_{1}{e}^{-3t}+{c}_{2}{e}^{2t}-5\ \text{cos}\ 2t+\text{sin}\ 2t\)
-
Use Cramer’s rule to solve the following system of equations.
\[\begin{array}{lll}{x}^{2}{z}_{1}+2x{z}_{2} & = & 0 \\ {z}_{1}-3{x}^{2}{z}_{2} & = & 2x\end{array}\]Sýna svarið
We have
\[\begin{array}{lll} \\ \\ {a}_{1}(x) & = & {x}^{2} \\ {a}_{2}(x) & = & 1 \\ {b}_{1}(x) & = & 2x \\ {b}_{2}(x) & = & -3{x}^{2} \\ {r}_{1}(x) & = & 0 \\ {r}_{2}(x) & = & 2x\text{.}\end{array}\]Then,
\[|\begin{array}{ll}{a}_{1} & {b}_{1} \\ {a}_{2} & {b}_{2}\end{array}|=|\begin{array}{ll}{x}^{2} & \ 2x \\ 1 & -3{x}^{2}\end{array}|=-3{x}^{4}-2x\]and
\[|\begin{array}{ll}{r}_{1} & {b}_{1} \\ {r}_{2} & {b}_{2}\end{array}|=|\begin{array}{ll}0 & \ 2x \\ 2x & -3{x}^{2}\end{array}|=0-4{x}^{2}=-4{x}^{2}.\]Thus,
\[{z}_{1}=\frac{|\begin{array}{ll}{r}_{1} & {b}_{1} \\ {r}_{2} & {b}_{2}\end{array}|}{|\begin{array}{ll}{a}_{1} & {b}_{1} \\ {a}_{2} & {b}_{2}\end{array}|}=\frac{-4{x}^{2}}{-3{x}^{4}-2x}=\frac{4x}{3{x}^{3}+2}.\]In addition,
\[|\begin{array}{ll}{a}_{1} & {r}_{1} \\ {a}_{2} & {r}_{2}\end{array}|=|\begin{array}{ll}{x}^{2} & 0 \\ 1 & 2x\end{array}|=2{x}^{3}-0=2{x}^{3}.\]Thus,
\[{z}_{2}=\frac{|\begin{array}{ll}{a}_{1} & {r}_{1} \\ {a}_{2} & {r}_{2}\end{array}|}{|\begin{array}{ll}{a}_{1} & {b}_{1} \\ {a}_{2} & {b}_{2}\end{array}|}=\frac{2{x}^{3}}{-3{x}^{4}-2x}=\frac{-2{x}^{2}}{3{x}^{3}+2}.\] -
Use Cramer’s rule to solve the following system of equations.
\[\begin{array}{lll}2x{z}_{1}-3{z}_{2} & = & 0 \\ {x}^{2}{z}_{1}+4x{z}_{2} & = & x+1\end{array}\]Sýna svarið
\({z}_{1}=\frac{3x+3}{11{x}^{2}},\) \({z}_{2}=\frac{2x+2}{11x}\)
-
Find the general solution to the following differential equations.
- \({y}^{″}-2{y}^{'}+y=\frac{{e}^{t}}{{t}^{2}}\)
- \({y}^{″}+y=3\ {\text{sin}}^{2}x\)
Sýna svarið
- The complementary equation is \({y}^{″}-2{y}^{'}+y=0\) with associated general solution \({c}_{1}{e}^{t}+{c}_{2}t{e}^{t}.\) Therefore, \({y}_{1}(t)={e}^{t}\) and \({y}_{2}(t)=t{e}^{t}.\) Calculating the derivatives, we get \({y}_{1}{}^{'}(t)={e}^{t}\) and \({y}_{2}{}^{'}(t)={e}^{t}+t{e}^{t}\) (step 1). Then, we want to find functions \({u}^{'}(t)\) and \({v}^{'}(t)\) so that
\[\begin{array}{lll}{u}^{'}{e}^{t}+{v}^{'}t{e}^{t} & = & 0 \\ {u}^{'}{e}^{t}+{v}^{'}({e}^{t}+t{e}^{t}) & = & \frac{{e}^{t}}{{t}^{2}}.\end{array}\]
Applying Cramer’s rule, we have
\[{u}^{'}=\frac{|\begin{array}{ll}0 & t{e}^{t} \\ \frac{{e}^{t}}{{t}^{2}} & {e}^{t}+t{e}^{t}\end{array}|}{|\begin{array}{ll}{e}^{t} & t{e}^{t} \\ {e}^{t} & {e}^{t}+t{e}^{t}\end{array}|}=\frac{0-t{e}^{t}(\frac{{e}^{t}}{{t}^{2}})}{{e}^{t}({e}^{t}+t{e}^{t})-{e}^{t}t{e}^{t}}=\frac{-\frac{{e}^{2t}}{t}}{{e}^{2t}}=-\frac{1}{t}\]
and
\[{v}^{'}=\frac{|\begin{array}{ll}{e}^{t} & 0 \\ {e}^{t} & \frac{{e}^{t}}{{t}^{2}}\end{array}|}{|\begin{array}{ll}{e}^{t} & t{e}^{t} \\ {e}^{t} & {e}^{t}+t{e}^{t}\end{array}|}=\frac{{e}^{t}(\frac{{e}^{t}}{{t}^{2}})}{{e}^{2t}}=\frac{1}{{t}^{2}}\ \text{(step 2).}\]
Integrating, we get
\[\begin{array}{l} \\ \\ u=\text{-}\int \frac{1}{t}dt=\text{-}\text{ln}|t| \\ v=\int \frac{1}{{t}^{2}}dt=-\frac{1}{t}\ \text{(step 3).}\end{array}\]
Then we have
\[\begin{array}{ll}{y}_{p} & =\text{-}{e}^{t}\text{ln}|t|-\frac{1}{t}t{e}^{t} \\ & =\text{-}{e}^{t}\text{ln}|t|-{e}^{t}\ \text{(step 4).}\end{array}\]
The \({e}^{t}\) term is a solution to the complementary equation, so we don’t need to carry that term into our general solution explicitly. The general solution is
\[y(t)={c}_{1}{e}^{t}+{c}_{2}t{e}^{t}-{e}^{t}\text{ln}|t|\ \text{(step 5).}\] - The complementary equation is \({y}^{″}+y=0\) with associated general solution \({c}_{1}\text{cos}\ x+{c}_{2}\text{sin}\ x\text{.}\) So, \({y}_{1}(x)=\text{cos}\ x\) and \({y}_{2}(x)=\text{sin}\ x\) (step 1). Then, we want to find functions \({u}^{'}(x)\) and \({v}^{'}(x)\) such that
\[\begin{array}{lll}{u}^{'}\text{cos}\ x+{v}^{'}\text{sin}\ x & = & 0 \\ \text{-}{u}^{'}\text{sin}\ x+{v}^{'}\text{cos}\ x & = & 3\ {\text{sin}}^{2}x\text{.}\end{array}\]
Applying Cramer’s rule, we have
\[{u}^{'}=\frac{|\begin{array}{ll}0 & \text{sin}\ x \\ 3\ {\text{sin}}^{2}x & \text{cos}\ x\end{array}|}{|\begin{array}{ll}\text{cos}\ x & \text{sin}\ x \\ \text{-}\text{sin}\ x & \text{cos}\ x\end{array}|}=\frac{0-3\ {\text{sin}}^{3}x}{{\text{cos}}^{2}x+{\text{sin}}^{2}x}=-3\ {\text{sin}}^{3}x\]
and
\[{v}^{'}=\frac{|\begin{array}{ll}\text{cos}\ x & 0 \\ \text{-}\text{sin}\ x & 3\ {\text{sin}}^{2}x\end{array}|}{|\begin{array}{ll}\text{cos}\ x & \text{sin}\ x \\ \text{-}\text{sin}\ x & \text{cos}\ x\end{array}|}=\frac{3\ {\text{sin}}^{2}x\ \text{cos}\ x}{1}=3\ {\text{sin}}^{2}x\ \text{cos}\ x\ \text{(step 2).}\]
Integrating first to find u, we get
\[u=\int -3\ {\text{sin}}^{3}xdx=-3[\text{-}\frac{1}{3}{\text{sin}}^{2}x\ \text{cos}\ x+\frac{2}{3}\int \text{sin}\ xdx]={\text{sin}}^{2}x\ \text{cos}\ x+2\ \text{cos}\ x\text{.}\]
Now, we integrate to find v. Using substitution (with \(w=\text{sin}\ x\)), we get
\[v=\int 3\ {\text{sin}}^{2}x\ \text{cos}\ xdx=\int 3{w}^{2}dw={w}^{3}={\text{sin}}^{3}x\text{.}\]
Then,
\[\begin{array}{ll}{y}_{p} & =({\text{sin}}^{2}x\ \text{cos}\ x+2\ \text{cos}\ x)\ \text{cos}\ x+({\text{sin}}^{3}x)\ \text{sin}\ x \\ & ={\text{sin}}^{2}x\ {\text{cos}}^{2}x+2\ {\text{cos}}^{2}x+{\text{sin}}^{4}x \\ & =2\ {\text{cos}}^{2}x+{\text{sin}}^{2}x({\text{cos}}^{2}x+{\text{sin}}^{2}x)\ \text{(step 3).} \\ & =2\ {\text{cos}}^{2}x+{\text{sin}}^{2}x \\ & ={\text{cos}}^{2}x+1\end{array}\]
The general solution is
\[y(x)={c}_{1}\text{cos}\ x+{c}_{2}\text{sin}\ x+1+{\text{cos}}^{2}x\ \text{(step 4).}\]
-
Find the general solution to the following differential equations.
- \({y}^{″}+y=\text{sec}\ x\)
- \({x}^{″}-2{x}^{'}+x=\frac{{e}^{t}}{t}\)
Sýna svarið
- \(y(x)={c}_{1}\text{cos}\ x+{c}_{2}\text{sin}\ x+\text{cos}\ x\ \text{ln}|\text{cos}\ x|+x\ \text{sin}\ x\)
- \(x(t)={c}_{1}{e}^{t}+{c}_{2}t{e}^{t}+t{e}^{t}\text{ln}|t|\)
-
\(2{y}^{″}-5{y}^{'}-12y=6\)
-
\(3{y}^{″}+{y}^{'}-4y=8\)
Sýna svarið
\(y={c}_{1}{e}^{-4x\text{/}3}+{c}_{2}{e}^{x}-2\)
-
\({y}^{″}-6{y}^{'}+5y={e}^{\text{-}x}\)
-
\({y}^{″}+16y={e}^{-2x}\)
Sýna svarið
\(y={c}_{1}\text{cos}\ 4x+{c}_{2}\text{sin}\ 4x+\frac{1}{20}{e}^{-2x}\)
-
\({y}^{″}-4y={x}^{2}+1\)
-
\({y}^{″}-4{y}^{'}+4y=8{x}^{2}+4x\)
Sýna svarið
\(y={c}_{1}{e}^{2x}+{c}_{2}x{e}^{2x}+2{x}^{2}+5x+4\)
-
\({y}^{″}-2{y}^{'}-3y=\text{sin}\ 2x\)
-
\({y}^{″}+2{y}^{'}+y=\text{sin}\ x+\text{cos}\ x\)
Sýna svarið
\(y={c}_{1}{e}^{\text{-}x}+{c}_{2}x{e}^{\text{-}x}+\frac{1}{2}\ \text{sin}\ x-\frac{1}{2}\ \text{cos}\ x\)
-
\({y}^{″}+9y={e}^{x}\text{cos}\ x\)
-
\({y}^{″}+y=3\ \text{sin}\ 2x+x\ \text{cos}\ 2x\)
Sýna svarið
\(y={c}_{1}\text{cos}\ x+{c}_{2}\text{sin}\ x-\frac{1}{3}x\ \text{cos}\ 2x-\frac{5}{9}\ \text{sin}\ 2x\)
-
\({y}^{″}+3{y}^{'}-28y=10{e}^{4x}\)
-
\({y}^{″}+10{y}^{'}+25y=x{e}^{-5x}+4\)
Sýna svarið
\(y={c}_{1}{e}^{-5x}+{c}_{2}x{e}^{-5x}+\frac{1}{6}{x}^{3}{e}^{-5x}+\frac{4}{25}\)
-
\({y}^{″}-{y}^{'}-y=x+{e}^{\text{-}x}\)
-
\({y}^{″}-3y={x}^{2}-4x+11\)
Sýna svarið
a. \({y}_{p}(x)=A{x}^{2}+Bx+C\)
b. \({y}_{p}(x)=-\frac{1}{3}{x}^{2}+\frac{4}{3}x-\frac{35}{9}\) -
\({y}^{″}-{y}^{'}-4y={e}^{x}\text{cos}\ 3x\)
-
\(2{y}^{″}-{y}^{'}+y=({x}^{2}-5x){e}^{\text{-}x}\)
Sýna svarið
a. \({y}_{p}(x)=(A{x}^{2}+Bx+C){e}^{\text{-}x}\)
b. \({y}_{p}(x)=(\frac{1}{4}{x}^{2}-\frac{5}{8}x-\frac{33}{32}){e}^{\text{-}x}\) -
\(4{y}^{″}+5{y}^{'}-2y={e}^{2x}+x\ \text{sin}\ x\)
-
\({y}^{″}-{y}^{'}-2y={x}^{2}{e}^{x}\text{sin}\ x\)
Sýna svarið
a. \({y}_{p}(x)=(A{x}^{2}+Bx+C){e}^{x}\text{cos}\ x\) \(+(D{x}^{2}+Ex+F){e}^{x}\text{sin}\ x\)
b. \({y}_{p}(x)=(-\frac{1}{10}{x}^{2}-\frac{11}{25}x-\frac{27}{250}){e}^{x}\text{cos}\ x\) \(+(-\frac{3}{10}{x}^{2}+\frac{2}{25}x+\frac{39}{250}){e}^{x}\text{sin}\ x\) -
\({y}^{″}+3{y}^{'}-4y=2{e}^{x}\)
-
\({y}^{″}+2{y}^{'}={e}^{3x}\)
Sýna svarið
\(y={c}_{1}+{c}_{2}{e}^{-2x}+\frac{1}{15}{e}^{3x}\)
-
\({y}^{″}+6{y}^{'}+9y={e}^{\text{-}x}\)
-
\({y}^{″}+2{y}^{'}-8y=6{e}^{2x}\)
Sýna svarið
\(y={c}_{1}{e}^{2x}+{c}_{2}{e}^{-4x}+x{e}^{2x}\)
-
\(4{y}^{″}+y=2\ \text{sin}\ x\)
-
\({y}^{″}-9y=8x\)
Sýna svarið
\(y={c}_{1}{e}^{3x}+{c}_{2}{e}^{-3x}-\frac{8x}{9}\)
-
\({y}^{″}+y=\text{sec}\ x,\ 0
-
\({y}^{″}+4y=3\ \text{csc}\ 2x,\ 0
Sýna svarið
\(y={c}_{1}\text{cos}\ 2x+{c}_{2}\text{sin}\ 2x-\frac{3}{2}x\ \text{cos}\ 2x+\frac{3}{4}\ \text{sin}\ 2x\ \text{ln}\ (\text{sin}\ 2x)\)
-
\({y}^{″}-2{y}^{'}+y=12{e}^{x},\) \({\text{y}}_{p}(x)=6{x}^{2}{e}^{x},\) \(y(0)=6,\ \ y'(0)=0\)
-
\({y}^{″}-7{y}^{'}=4x{e}^{7x},\) \({y}_{p}(x)=\frac{2}{7}{x}^{2}{e}^{7x}-\frac{4}{49}x{e}^{7x},\) \(y(0)=-1,\ \ y'(0)=0\)
Sýna svarið
\(y=-\frac{347}{343}+\frac{4}{343}{e}^{7x}+\frac{2}{7}{x}^{2}{e}^{7x}-\frac{4}{49}x{e}^{7x}\)
-
\({y}^{″}+y=\text{cos}\ x-4\ \text{sin}\ x,\) \({y}_{p}(x)=2x\ \text{cos}\ x+\frac{1}{2}x\ \text{sin}\ x,\) \(y(0)=8,\ \ y'(0)=-4\)
Symbols used here
2.71828…, the base whose exponential is its own derivative.
The value f(x) approaches as x approaches a.
Instantaneous rate of change; slope of the graph.
Antiderivative (indefinite) or signed area from a to b (definite).
Prime notation for derivatives with respect to x (or t).
Constants of integration fixed by initial conditions.
Rate of change in time; sum of second partials (the diffusion operator).
How to: Nonhomogeneous Linear Equations
- Write the general solution to a nonhomogeneous differential equation.
- Solve a nonhomogeneous differential equation by the method of undetermined coefficients.
- Solve a nonhomogeneous differential equation by the method of variation of parameters.
- Solve the complementary equation and write down the general solution.
- Based on the form of
- Check whether any term in the guess for
- Substitute
- Add the general solution to the complementary equation and the particular solution you just found to obtain the general solution to the nonhomogeneous equation.
Questions people ask
What is a differential equation?
An equation whose unknown is a function, relating it to its own derivatives. "The rate of growth is proportional to the population" is y′ = ky, and solving it means finding y as a function of time.
Why does the solution have arbitrary constants?
Integrating loses information: many functions share the same derivative. An n-th order equation has n constants, fixed by n initial or boundary conditions.
Prófaðu þitt eigið
Parts of this page are adapted from OpenStax Calculus Volume 3 (CC BY-NC-SA 4.0). Condensed and re-explained here; errors are ours.
Meira í Differential Equations
Separable equationsFirst-order linear equationsSecond-order, constant coefficientsNonhomogeneous equationsModelling with differential equations