How to Solve Differential Equations
How to Solve Differential Equations
A differential equation is an equation that relates a function with one or more of its derivatives. In most applications, the functions represent physical quantities, the derivatives represent their rates of change, and the equation defines a relationship between them.
In this article, we show the techniques required to solve certain types of ordinary differential equations whose solutions can be written out in terms of elementary functions – polynomials, exponentials, logarithms, and trigonometric functions and their inverses. Many of these equations are encountered in real life, but most others cannot be solved using these techniques, instead requiring that the answer be written in terms of special functions, power series, or be computed numerically.
This article assumes that you have a good understanding of both differential and integral calculus, as well as some knowledge of partial derivatives. It is also recommended that you have some knowledge on linear algebra for the theory behind differential equations, especially for the part regarding second-order differential equations, although actually solving them only requires knowledge of calculus.
Preliminaries

First Order Equations

Linear first-order equations. In this section, we discuss the methods of solving the linear first-order differential equation both in general and in the special cases where certain terms are set to 0. We let y = y ( x ) , {\displaystyle y=y(x),} y=y(x), p ( x ) , {\displaystyle p(x),} p(x), and q ( x ) {\displaystyle q(x)} q(x) be functions of x . {\displaystyle x.} x. d y d x + p ( x ) y = q ( x ) {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}+p(x)y=q(x)} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+p(x)y=q(x) p ( x ) = 0. {\displaystyle p(x)=0.} p(x)=0. By the fundamental theorem of calculus, the integral of a derivative of a function is the function itself. We can then simply integrate to obtain our answer. Remember that evaluating an indefinite integral introduces an arbitrary constant. y ( x ) = ∫ q ( x ) d x {\displaystyle y(x)=\int q(x)\mathrm {d} x} y(x)=\int q(x){\mathrm {d}}x q ( x ) = 0. {\displaystyle q(x)=0.} q(x)=0. We use the technique of separation of variables. Separation of variables intuitively puts each variable on different sides of the equation. For example, we move all y {\displaystyle y} y terms to one side and the x {\displaystyle x} x terms to the other. We may treat the d x {\displaystyle \mathrm {d} x} {\mathrm {d}}x and d y {\displaystyle \mathrm {d} y} {\mathrm {d}}y in the derivative as quantities that are able to be moved around, but keep in mind that this is merely a shorthand for a manipulation that takes advantage of the chain rule. The exact nature of these objects, called differentials, are outside the scope of this article. First, we get each variable on opposite sides of the equation. 1 y d y = − p ( x ) d x {\displaystyle {\frac {1}{y}}\mathrm {d} y=-p(x)\mathrm {d} x} {\frac {1}{y}}{\mathrm {d}}y=-p(x){\mathrm {d}}x Integrate both sides. The integration introduces an arbitrary constant on both sides, but we may consolidate them on the right side. ln ⁡ y = ∫ − p ( x ) d x {\displaystyle \ln y=\int -p(x)\mathrm {d} x} \ln y=\int -p(x){\mathrm {d}}x y ( x ) = e − ∫ p ( x ) d x {\displaystyle y(x)=e^{-\int p(x)\mathrm {d} x}} y(x)=e^{{-\int p(x){\mathrm {d}}x}} Example 1.1. In the last step, we take advantage of the exponent law e a + b = e a e b {\displaystyle e^{a+b}=e^{a}e^{b}} e^{{a+b}}=e^{{a}}e^{{b}} and replace e C {\displaystyle e^{C}} e^{{C}} with C {\displaystyle C} C because it is again an arbitrary constant. d y d x − 2 y sin ⁡ x = {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}-2y\sin x=0} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}-2y\sin x=0 1 2 y d y = sin ⁡ x d x 1 2 ln ⁡ y = − cos ⁡ x + C ln ⁡ y = − 2 cos ⁡ x + C y ( x ) = C e − 2 cos ⁡ x {\displaystyle {\begin{aligned}{\frac {1}{2y}}\mathrm {d} y&=\sin x\mathrm {d} x\\{\frac {1}{2}}\ln y&=-\cos x+C\\\ln y&=-2\cos x+C\\y(x)&=Ce^{-2\cos x}\end{aligned}}} {\begin{aligned}{\frac {1}{2y}}{\mathrm {d}}y&=\sin x{\mathrm {d}}x\\{\frac {1}{2}}\ln y&=-\cos x+C\\\ln y&=-2\cos x+C\\y(x)&=Ce^{{-2\cos x}}\end{aligned}} p ( x ) ≠ 0 , q ( x ) ≠ 0. {\displaystyle p(x)\neq 0,\ q(x)\neq 0.} p(x)\neq 0,\ q(x)\neq 0. To solve the general case, we introduce an integrating factor μ ( x ) , {\displaystyle \mu (x),} \mu (x), a function of x {\displaystyle x} x that makes the equation easier to solve by bringing the left side under a common derivative. Multiply both sides by μ ( x ) . {\displaystyle \mu (x).} \mu (x). μ d y d x + μ p y = μ q {\displaystyle \mu {\frac {\mathrm {d} y}{\mathrm {d} x}}+\mu py=\mu q} \mu {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+\mu py=\mu q In order to bring the left side under a common derivative, we must have the following. d d x ( μ y ) = d μ d x y + μ d y d x = μ d y d x + μ p y {\displaystyle {\frac {\mathrm {d} }{\mathrm {d} x}}(\mu y)={\frac {\mathrm {d} \mu }{\mathrm {d} x}}y+\mu {\frac {\mathrm {d} y}{\mathrm {d} x}}=\mu {\frac {\mathrm {d} y}{\mathrm {d} x}}+\mu py} {\frac {{\mathrm {d}}}{{\mathrm {d}}x}}(\mu y)={\frac {{\mathrm {d}}\mu }{{\mathrm {d}}x}}y+\mu {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}=\mu {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+\mu py The latter equation implies that d μ d x = μ p , {\displaystyle {\frac {\mathrm {d} \mu }{\mathrm {d} x}}=\mu p,} {\frac {{\mathrm {d}}\mu }{{\mathrm {d}}x}}=\mu p, which has the following solution. This is the integrating factor that solves every linear first-order equation. We may now proceed to derive a formula that solves this equation in terms of μ , {\displaystyle \mu ,} \mu , but it is more instructive to simply do the calculations. μ ( x ) = e ∫ p ( x ) d x {\displaystyle \mu (x)=e^{\int p(x)\mathrm {d} x}} \mu (x)=e^{{\int p(x){\mathrm {d}}x}} Example 1.2. This example also introduces the notion of finding a particular solution to the differential equation given initial conditions. t d y d t + 2 y = t 2 , y ( 2 ) = 3 {\displaystyle t{\frac {\mathrm {d} y}{\mathrm {d} t}}+2y=t^{2},\quad y(2)=3} t{\frac {{\mathrm {d}}y}{{\mathrm {d}}t}}+2y=t^{{2}},\quad y(2)=3 d y d t + 2 t y = t {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} t}}+{\frac {2}{t}}y=t} {\frac {{\mathrm {d}}y}{{\mathrm {d}}t}}+{\frac {2}{t}}y=t μ ( t ) = e ∫ p ( t ) d t = e 2 ln ⁡ t = t 2 {\displaystyle \mu (t)=e^{\int p(t)\mathrm {d} t}=e^{2\ln t}=t^{2}} {\displaystyle \mu (t)=e^{\int p(t)\mathrm {d} t}=e^{2\ln t}=t^{2}} d d t ( t 2 y ) = t 3 t 2 y = 1 4 t 4 + C y ( t ) = 1 4 t 2 + C t 2 {\displaystyle {\begin{aligned}{\frac {\mathrm {d} }{\mathrm {d} t}}(t^{2}y)&=t^{3}\\t^{2}y&={\frac {1}{4}}t^{4}+C\\y(t)&={\frac {1}{4}}t^{2}+{\frac {C}{t^{2}}}\end{aligned}}} {\begin{aligned}{\frac {{\mathrm {d}}}{{\mathrm {d}}t}}(t^{{2}}y)&=t^{{3}}\\t^{{2}}y&={\frac {1}{4}}t^{{4}}+C\\y(t)&={\frac {1}{4}}t^{{2}}+{\frac {C}{t^{{2}}}}\end{aligned}} 3 = y ( 2 ) = 1 + C 4 , C = 8 {\displaystyle 3=y(2)=1+{\frac {C}{4}},\quad C=8} 3=y(2)=1+{\frac {C}{4}},\quad C=8 y ( t ) = 1 4 t 2 + 8 t 2 {\displaystyle y(t)={\frac {1}{4}}t^{2}+{\frac {8}{t^{2}}}} y(t)={\frac {1}{4}}t^{{2}}+{\frac {8}{t^{{2}}}}

Nonlinear first-order equations. In this section, we discuss the methods of solving certain nonlinear first-order differential equations. There is no general solution in closed form, but certain equations are able to be solved using the techniques below. d y d x = f ( x , y ) {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}=f(x,y)} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}=f(x,y) d y d x = h ( x ) g ( y ) . {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}=h(x)g(y).} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}=h(x)g(y). If the function f ( x , y ) = h ( x ) g ( y ) {\displaystyle f(x,y)=h(x)g(y)} f(x,y)=h(x)g(y) can be separated into functions of one variable each, then the equation is said to be separable. We then proceed with the same method as before. ∫ d y h ( y ) = ∫ g ( x ) d x {\displaystyle \int {\frac {\mathrm {d} y}{h(y)}}=\int g(x)\mathrm {d} x} \int {\frac {{\mathrm {d}}y}{h(y)}}=\int g(x){\mathrm {d}}x Example 1.3. d y d x = x 3 y ( 1 + x 4 ) {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}={\frac {x^{3}}{y(1+x^{4})}}} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}={\frac {x^{{3}}}{y(1+x^{{4}})}} ∫ y d y = ∫ x 3 1 + x 4 d x 1 2 y 2 = 1 4 ln ⁡ ( 1 + x 4 ) + C y ( x ) = 1 2 ln ⁡ ( 1 + x 4 ) + C {\displaystyle {\begin{aligned}\int y\mathrm {d} y&=\int {\frac {x^{3}}{1+x^{4}}}\mathrm {d} x\\{\frac {1}{2}}y^{2}&={\frac {1}{4}}\ln(1+x^{4})+C\\y(x)&={\frac {1}{2}}\ln(1+x^{4})+C\end{aligned}}} {\begin{aligned}\int y{\mathrm {d}}y&=\int {\frac {x^{{3}}}{1+x^{{4}}}}{\mathrm {d}}x\\{\frac {1}{2}}y^{{2}}&={\frac {1}{4}}\ln(1+x^{{4}})+C\\y(x)&={\frac {1}{2}}\ln(1+x^{{4}})+C\end{aligned}} d y d x = g ( x , y ) h ( x , y ) . {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}={\frac {g(x,y)}{h(x,y)}}.} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}={\frac {g(x,y)}{h(x,y)}}. Let g ( x , y ) {\displaystyle g(x,y)} g(x,y) and h ( x , y ) {\displaystyle h(x,y)} h(x,y) be functions of x {\displaystyle x} x and y . {\displaystyle y.} y. Then a homogeneous differential equation is an equation where g {\displaystyle g} g and h {\displaystyle h} h are homogeneous functions of the same degree. That is to say, the function satisfies the property g ( α x , α y ) = α k g ( x , y ) , {\displaystyle g(\alpha x,\alpha y)=\alpha ^{k}g(x,y),} g(\alpha x,\alpha y)=\alpha ^{{k}}g(x,y), where k {\displaystyle k} k is called the degree of homogeneity. Every homogeneous differential equation can be converted into a separable equation through a sufficient change of variables, either v = y / x {\displaystyle v=y/x} v=y/x or v = x / y . {\displaystyle v=x/y.} v=x/y. Example 1.4. The above discussion regarding homogeneity may be somewhat arcane. Let us see how this applies through an example. d y d x = y 3 − x 3 y 2 x {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}={\frac {y^{3}-x^{3}}{y^{2}x}}} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}={\frac {y^{{3}}-x^{{3}}}{y^{{2}}x}} We first observe that this is a nonlinear equation in y . {\displaystyle y.} y. We also see that this equation cannot be separated. However, it is a homogeneous differential equation because both the top and bottom are homogeneous of degree 3. Therefore, we can make the change of variables v = y / x . {\displaystyle v=y/x.} v=y/x. d y d x = y x − x 2 y 2 = v − 1 v 2 {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}={\frac {y}{x}}-{\frac {x^{2}}{y^{2}}}=v-{\frac {1}{v^{2}}}} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}={\frac {y}{x}}-{\frac {x^{{2}}}{y^{{2}}}}=v-{\frac {1}{v^{{2}}}} y = v x , d y d x = d v d x x + v {\displaystyle y=vx,\quad {\frac {\mathrm {d} y}{\mathrm {d} x}}={\frac {\mathrm {d} v}{\mathrm {d} x}}x+v} y=vx,\quad {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}={\frac {{\mathrm {d}}v}{{\mathrm {d}}x}}x+v d v d x x = − 1 v 2 . {\displaystyle {\frac {\mathrm {d} v}{\mathrm {d} x}}x=-{\frac {1}{v^{2}}}.} {\frac {{\mathrm {d}}v}{{\mathrm {d}}x}}x=-{\frac {1}{v^{{2}}}}. This is now a separable equation in v . {\displaystyle v.} v. v ( x ) = − 3 ln ⁡ x + C 3 {\displaystyle v(x)={\sqrt[{3}]{-3\ln x+C}}} v(x)={\sqrt[ {3}]{-3\ln x+C}} y ( x ) = x − 3 ln ⁡ x + C 3 {\displaystyle y(x)=x{\sqrt[{3}]{-3\ln x+C}}} y(x)=x{\sqrt[ {3}]{-3\ln x+C}} d y d x = p ( x ) y + q ( x ) y n . {\displaystyle {\frac {\mathrm {d} y}{\mathrm {d} x}}=p(x)y+q(x)y^{n}.} {\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}=p(x)y+q(x)y^{{n}}. This is the Bernoulli differential equation, a particular example of a nonlinear first-order equation with solutions that can be written in terms of elementary functions. Multiply by ( 1 − n ) y − n . {\displaystyle (1-n)y^{-n}.} (1-n)y^{{-n}}. ( 1 − n ) y − n d y d x = p ( x ) ( 1 − n ) y 1 − n + ( 1 − n ) q ( x ) {\displaystyle (1-n)y^{-n}{\frac {\mathrm {d} y}{\mathrm {d} x}}=p(x)(1-n)y^{1-n}+(1-n)q(x)} (1-n)y^{{-n}}{\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}=p(x)(1-n)y^{{1-n}}+(1-n)q(x) Use the chain rule on the left side to convert the equation into a linear equation in y 1 − n , {\displaystyle y^{1-n},} y^{{1-n}}, which can then be solved using the previous techniques. d y 1 − n d x = p ( x ) ( 1 − n ) y 1 − n + ( 1 − n ) q ( x ) {\displaystyle {\frac {\mathrm {d} y^{1-n}}{\mathrm {d} x}}=p(x)(1-n)y^{1-n}+(1-n)q(x)} {\frac {{\mathrm {d}}y^{{1-n}}}{{\mathrm {d}}x}}=p(x)(1-n)y^{{1-n}}+(1-n)q(x) M ( x , y ) + N ( x , y ) d y d x = 0. {\displaystyle M(x,y)+N(x,y){\frac {\mathrm {d} y}{\mathrm {d} x}}=0.} M(x,y)+N(x,y){\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}=0. Here, we discuss exact equations. We wish to find a function φ ( x , y ) , {\displaystyle \varphi (x,y),} \varphi (x,y), called the potential function, such that d φ d x = 0. {\displaystyle {\frac {\mathrm {d} \varphi }{\mathrm {d} x}}=0.} {\frac {{\mathrm {d}}\varphi }{{\mathrm {d}}x}}=0. To fulfill this condition, we have the following total derivative. The total derivative allows for additional variable dependencies. To calculate the total derivative of φ {\displaystyle \varphi } \varphi with respect to x , {\displaystyle x,} x, we allow for the possibility that y {\displaystyle y} y may also depend on x . {\displaystyle x.} x. d φ d x = ∂ φ ∂ x + ∂ φ ∂ y d y d x {\displaystyle {\frac {\mathrm {d} \varphi }{\mathrm {d} x}}={\frac {\partial \varphi }{\partial x}}+{\frac {\partial \varphi }{\partial y}}{\frac {\mathrm {d} y}{\mathrm {d} x}}} {\frac {{\mathrm {d}}\varphi }{{\mathrm {d}}x}}={\frac {\partial \varphi }{\partial x}}+{\frac {\partial \varphi }{\partial y}}{\frac {{\mathrm {d}}y}{{\mathrm {d}}x}} Comparing terms, we have M ( x , y ) = ∂ φ ∂ x {\displaystyle M(x,y)={\frac {\partial \varphi }{\partial x}}} M(x,y)={\frac {\partial \varphi }{\partial x}} and N ( x , y ) = ∂ φ ∂ y . {\displaystyle N(x,y)={\frac {\partial \varphi }{\partial y}}.} N(x,y)={\frac {\partial \varphi }{\partial y}}. It is a standard result from multivariable calculus that mixed derivatives for smooth functions are equal to each other. This is sometimes known as Clairaut's theorem. The differential equation is then exact if the following condition holds. ∂ M ∂ y = ∂ N ∂ x {\displaystyle {\frac {\partial M}{\partial y}}={\frac {\partial N}{\partial x}}} {\frac {\partial M}{\partial y}}={\frac {\partial N}{\partial x}} The method of solving exact equations is similar to finding potential functions in multivariable calculus, which we go into very shortly. We first integrate M {\displaystyle M} M with respect to x . {\displaystyle x.} x. Because M {\displaystyle M} M is a function of both x {\displaystyle x} x and y , {\displaystyle y,} y, the integration can only partially recover φ , {\displaystyle \varphi ,} \varphi , which the term φ ~ {\displaystyle {\tilde {\varphi }}} {\tilde {\varphi }} is intended to remind the reader of. There is also an integration constant that is a function of y . {\displaystyle y.} y. φ ( x , y ) = ∫ M ( x , y ) d x = φ ~ ( x , y ) + c ( y ) {\displaystyle \varphi (x,y)=\int M(x,y)\mathrm {d} x={\tilde {\varphi }}(x,y)+c(y)} \varphi (x,y)=\int M(x,y){\mathrm {d}}x={\tilde {\varphi }}(x,y)+c(y) We then take the partial derivative of our result with respect to y , {\displaystyle y,} y, compare terms with N ( x , y ) , {\displaystyle N(x,y),} N(x,y), and integrate to obtain c ( y ) . {\displaystyle c(y).} c(y). We can also start by integrating N {\displaystyle N} N first and then taking the partial derivative of our result with respect to x {\displaystyle x} x to solve for the arbitrary function d ( x ) . {\displaystyle d(x).} d(x). Either method is fine, and usually, the simpler function to integrate is chosen. N ( x , y ) = ∂ φ ∂ y = ∂ φ ~ ∂ y + d c d y {\displaystyle N(x,y)={\frac {\partial \varphi }{\partial y}}={\frac {\partial {\tilde {\varphi }}}{\partial y}}+{\frac {\mathrm {d} c}{\mathrm {d} y}}} N(x,y)={\frac {\partial \varphi }{\partial y}}={\frac {\partial {\tilde {\varphi }}}{\partial y}}+{\frac {{\mathrm {d}}c}{{\mathrm {d}}y}} Example 1.5. We can check that the equation below is exact by doing the partial derivatives. 3 x 2 + y 2 + 2 x y d y d x = 0 {\displaystyle 3x^{2}+y^{2}+2xy{\frac {\mathrm {d} y}{\mathrm {d} x}}=0} 3x^{{2}}+y^{{2}}+2xy{\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}=0 φ = ∫ ( 3 x 2 + y 2 ) d x = x 3 + x y 2 + c ( y ) ∂ φ ∂ y = N ( x , y ) = 2 x y + d c d y {\displaystyle {\begin{aligned}\varphi &=\int (3x^{2}+y^{2})\mathrm {d} x=x^{3}+xy^{2}+c(y)\\{\frac {\partial \varphi }{\partial y}}&=N(x,y)=2xy+{\frac {\mathrm {d} c}{\mathrm {d} y}}\end{aligned}}} {\begin{aligned}\varphi &=\int (3x^{{2}}+y^{{2}}){\mathrm {d}}x=x^{{3}}+xy^{{2}}+c(y)\\{\frac {\partial \varphi }{\partial y}}&=N(x,y)=2xy+{\frac {{\mathrm {d}}c}{{\mathrm {d}}y}}\end{aligned}} d c d y = 0 , c ( y ) = C {\displaystyle {\frac {\mathrm {d} c}{\mathrm {d} y}}=0,\quad c(y)=C} {\frac {{\mathrm {d}}c}{{\mathrm {d}}y}}=0,\quad c(y)=C x 3 + x y 2 = C {\displaystyle x^{3}+xy^{2}=C} x^{{3}}+xy^{{2}}=C If our differential equation is not exact, then there are certain instances where we can find an integrating factor that makes it exact. However, these equations are even harder to find applications of in the sciences, and integrating factors, though guaranteed to exist, are not at all guaranteed to easily be found. As such, we will not go into them here.

Second Order Equations

Homogeneous linear differential equations with constant coefficients. These equations are some of the most important to solve because of their widespread applicability. Here, homogeneous does not refer to homogeneous functions, but the fact that the equation is set to 0. We will see in the next section on how to solve the corresponding inhomogeneous differential equations. Below, a {\displaystyle a} a and b {\displaystyle b} b are constants. d 2 y d x 2 + a d y d x + b y = {\displaystyle {\frac {\mathrm {d} ^{2}y}{\mathrm {d} x^{2}}}+a{\frac {\mathrm {d} y}{\mathrm {d} x}}+by=0} {\frac {{\mathrm {d}}^{{2}}y}{{\mathrm {d}}x^{{2}}}}+a{\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+by=0 Characteristic equation. This differential equation is notable because we can solve it very easily if we make some observations about what properties its solutions must have. This equation tells us that y {\displaystyle y} y and its derivatives are all proportional to each other. From our previous examples in dealing with first-order equations, we know that only the exponential function has this property. Therefore, we will put forth an ansatz – an educated guess – on what the solution will be. This ansatz is the exponential function e r x , {\displaystyle e^{rx},} e^{{rx}}, where r {\displaystyle r} r is a constant to be determined. Substituting into the equation, we have the following. e r x ( r 2 + a r + b ) = 0 {\displaystyle e^{rx}(r^{2}+ar+b)=0} e^{{rx}}(r^{{2}}+ar+b)=0 This equation tells us that an exponential function multiplied by a polynomial must equal 0. We know that the exponential function cannot be 0 anywhere. The polynomial being set to 0 is deemed the characteristic equation. We have effectively converted a differential equation problem into an algebraic equation problem – a problem that is much easier to solve. r 2 + a r + b = 0 {\displaystyle r^{2}+ar+b=0} r^{{2}}+ar+b=0 r ± = − a ± a 2 − 4 b 2 {\displaystyle r_{\pm }={\frac {-a\pm {\sqrt {a^{2}-4b}}}{2}}} r_{{\pm }}={\frac {-a\pm {\sqrt {a^{{2}}-4b}}}{2}} We obtain two roots. Because this differential equation is a linear equation, the general solution consists of a linear combination of the individual solutions. Because this is a second-order equation, we know that this is the general solution. There are no others to be found. A more rigorous justification is contained in the existence and uniqueness theorems found in the literature. A useful way to check if two solutions are linearly independent is by way of the Wronskian. The Wronskian W {\displaystyle W} W is the determinant of a matrix whose columns are the functions and their successive derivatives going down the rows. A theorem in linear algebra is that the functions in the Wronskian matrix are linearly dependent if the Wronskian vanishes. In this part, we can check if two solutions are linearly independent by making sure that the Wronskian does not vanish. The Wronskian will become important in solving inhomogeneous differential equations with constant coefficients via the variation of parameters. W = | y 1 y 2 y 1 ′ y 2 ′ | {\displaystyle W={\begin{vmatrix}y_{1}&y_{2}\\y_{1}'&y_{2}'\end{vmatrix}}} W={\begin{vmatrix}y_{{1}}&y_{{2}}\\y_{{1}}'&y_{{2}}'\end{vmatrix}} In terms of linear algebra, the solution set of this differential equation spans a vector space with dimension equal to the order of the differential equation. The solutions form a basis and are therefore linearly independent of one another. This is possible because the function y ( x ) {\displaystyle y(x)} y(x) is being acted on by a linear operator. The derivative is a linear operator because it maps the space of differentiable functions to the space of all functions. The reason why this is a homogeneous equation is because, for any linear operator L , {\displaystyle L,} L, we are looking for solutions of the equation L [ y ] = 0. {\displaystyle L[y]=0.} L[y]=0. We now proceed to go over two of the three cases. The repeated roots case will have to wait until the section on reduction of order. Two real and distinct roots. If r ± {\displaystyle r_{\pm }} r_{{\pm }} are both real and are distinct, then the solution to the differential equation is given below. y ( x ) = c 1 e r + x + c 2 e r − x {\displaystyle y(x)=c_{1}e^{r_{+}x}+c_{2}e^{r_{-}x}} y(x)=c_{{1}}e^{{r_{{+}}x}}+c_{{2}}e^{{r_{{-}}x}} Two complex roots. It is a corollary of the fundamental theorem of algebra that solutions to polynomial equations with real coefficients contain roots that are real or come in conjugate pairs. Hence if r = α + i β {\displaystyle r=\alpha +i\beta } r=\alpha +i\beta is complex and is a root of the characteristic equation, then r ∗ = α − i β {\displaystyle r^{*}=\alpha -i\beta } r^{{*}}=\alpha -i\beta is a root as well. We can then write out the solution as c 1 e ( α + i β ) x + c 2 e ( α − i β ) x , {\displaystyle c_{1}e^{(\alpha +i\beta )x}+c_{2}e^{(\alpha -i\beta )x},} c_{{1}}e^{{(\alpha +i\beta )x}}+c_{{2}}e^{{(\alpha -i\beta )x}}, but this solution is complex and is undesirable as an answer for a real differential equation. We can instead make use of Euler's formula e i x = cos ⁡ x + i sin ⁡ x {\displaystyle e^{ix}=\cos x+i\sin x} e^{{ix}}=\cos x+i\sin x to write out the solution in terms of trigonometric functions. e α x ( c 1 cos ⁡ β x + i c 1 sin ⁡ β x + c 2 cos ⁡ β x − i c 2 sin ⁡ β x ) {\displaystyle e^{\alpha x}(c_{1}\cos \beta x+ic_{1}\sin \beta x+c_{2}\cos \beta x-ic_{2}\sin \beta x)} e^{{\alpha x}}(c_{{1}}\cos \beta x+ic_{{1}}\sin \beta x+c_{{2}}\cos \beta x-ic_{{2}}\sin \beta x) We now replace the constant c 1 + c 2 {\displaystyle c_{1}+c_{2}} c_{{1}}+c_{{2}} with c 1 {\displaystyle c_{1}} c_{{1}} and replace i ( c 1 − c 2 ) {\displaystyle i(c_{1}-c_{2})} i(c_{{1}}-c_{{2}}) with c 2 . {\displaystyle c_{2}.} c_{{2}}. This yields the solution below. y ( x ) = e α x ( c 1 cos ⁡ β x + c 2 sin ⁡ β x ) {\displaystyle y(x)=e^{\alpha x}(c_{1}\cos \beta x+c_{2}\sin \beta x)} y(x)=e^{{\alpha x}}(c_{{1}}\cos \beta x+c_{{2}}\sin \beta x) There is yet another way to write out this solution in terms of an amplitude and phase, which is typically more useful in physical applications. See the main article for details on this calculation. Example 2.1. Find the solution to the differential equation below given initial conditions. To do so, we must use our solution as well as its derivative and substitute initial conditions in both results to solve for the arbitrary constants. d 2 x d t 2 + 3 d x d t + 10 x = 0 , x ( 0 ) = 1 , x ′ ( 0 ) = − 1 {\displaystyle {\frac {\mathrm {d} ^{2}x}{\mathrm {d} t^{2}}}+3{\frac {\mathrm {d} x}{\mathrm {d} t}}+10x=0,\quad x(0)=1,\ x'(0)=-1} {\frac {{\mathrm {d}}^{{2}}x}{{\mathrm {d}}t^{{2}}}}+3{\frac {{\mathrm {d}}x}{{\mathrm {d}}t}}+10x=0,\quad x(0)=1,\ x'(0)=-1 r 2 + 3 r + 10 = 0 , r ± = − 3 ± 9 − 40 2 = − 3 2 ± 31 2 i {\displaystyle r^{2}+3r+10=0,\quad r_{\pm }={\frac {-3\pm {\sqrt {9-40}}}{2}}=-{\frac {3}{2}}\pm {\frac {\sqrt {31}}{2}}i} r^{{2}}+3r+10=0,\quad r_{{\pm }}={\frac {-3\pm {\sqrt {9-40}}}{2}}=-{\frac {3}{2}}\pm {\frac {{\sqrt {31}}}{2}}i x ( t ) = e − 3 t / 2 ( c 1 cos ⁡ 31 2 t + c 2 sin ⁡ 31 2 t ) {\displaystyle x(t)=e^{-3t/2}\left(c_{1}\cos {\frac {\sqrt {31}}{2}}t+c_{2}\sin {\frac {\sqrt {31}}{2}}t\right)} x(t)=e^{{-3t/2}}\left(c_{{1}}\cos {\frac {{\sqrt {31}}}{2}}t+c_{{2}}\sin {\frac {{\sqrt {31}}}{2}}t\right) x ( 0 ) = 1 = c 1 {\displaystyle x(0)=1=c_{1}} x(0)=1=c_{{1}} x ′ ( t ) = − 3 2 e − 3 t / 2 ( c 1 cos ⁡ 31 2 t + c 2 sin ⁡ 31 2 t ) + e − 3 t / 2 ( − 31 2 c 1 sin ⁡ 31 2 t + 31 2 c 2 cos ⁡ 31 2 t ) {\displaystyle {\begin{aligned}x'(t)&=-{\frac {3}{2}}e^{-3t/2}\left(c_{1}\cos {\frac {\sqrt {31}}{2}}t+c_{2}\sin {\frac {\sqrt {31}}{2}}t\right)\\&+e^{-3t/2}\left(-{\frac {\sqrt {31}}{2}}c_{1}\sin {\frac {\sqrt {31}}{2}}t+{\frac {\sqrt {31}}{2}}c_{2}\cos {\frac {\sqrt {31}}{2}}t\right)\end{aligned}}} {\begin{aligned}x'(t)&=-{\frac {3}{2}}e^{{-3t/2}}\left(c_{{1}}\cos {\frac {{\sqrt {31}}}{2}}t+c_{{2}}\sin {\frac {{\sqrt {31}}}{2}}t\right)\\&+e^{{-3t/2}}\left(-{\frac {{\sqrt {31}}}{2}}c_{{1}}\sin {\frac {{\sqrt {31}}}{2}}t+{\frac {{\sqrt {31}}}{2}}c_{{2}}\cos {\frac {{\sqrt {31}}}{2}}t\right)\end{aligned}} x ′ ( 0 ) = − 1 = − 3 2 c 1 + 31 2 c 2 , c 2 = 1 31 {\displaystyle x'(0)=-1=-{\frac {3}{2}}c_{1}+{\frac {\sqrt {31}}{2}}c_{2},\quad c_{2}={\frac {1}{\sqrt {31}}}} x'(0)=-1=-{\frac {3}{2}}c_{{1}}+{\frac {{\sqrt {31}}}{2}}c_{{2}},\quad c_{{2}}={\frac {1}{{\sqrt {31}}}} x ( t ) = e − 3 t / 2 ( cos ⁡ 31 2 t + 1 31 sin ⁡ 31 2 t ) {\displaystyle x(t)=e^{-3t/2}\left(\cos {\frac {\sqrt {31}}{2}}t+{\frac {1}{\sqrt {31}}}\sin {\frac {\sqrt {31}}{2}}t\right)} x(t)=e^{{-3t/2}}\left(\cos {\frac {{\sqrt {31}}}{2}}t+{\frac {1}{{\sqrt {31}}}}\sin {\frac {{\sqrt {31}}}{2}}t\right)

Reduction of order. Reduction of order is a method in solving differential equations when one linearly independent solution is known. The method works by reducing the order of the equation by one, allowing for the equation to be solved using the techniques outlined in the previous part. Let y 1 ( x ) {\displaystyle y_{1}(x)} y_{{1}}(x) be the known solution. The basic idea of reduction of order is to look for a solution of the following form, where v ( x ) {\displaystyle v(x)} v(x) is a function to be determined, substitute into the differential equation, and solve for v ( x ) . {\displaystyle v(x).} v(x). We will see how reduction of order can be applied in finding the solution to the differential equation with constant coefficients with repeated roots. y ( x ) = v ( x ) y 1 ( x ) {\displaystyle y(x)=v(x)y_{1}(x)} y(x)=v(x)y_{{1}}(x) Repeated roots to the homogeneous differential equation with constant coefficients. Recall that a second-order equation should have two linearly independent solutions. If the characteristic equation yields a repeating root, then the solution set fails to span the space because the solutions are linearly dependent. We must then use reduction of order to find the second linearly independent solution. Let r {\displaystyle r} r denote the repeated root of the characteristic equation. We assume the second solution as y ( x ) = e r x v ( x ) {\displaystyle y(x)=e^{rx}v(x)} y(x)=e^{{rx}}v(x) and substitute this into the differential equation. We find that most of the terms, save the term with the second derivative of v , {\displaystyle v,} v, cancel. v ″ ( x ) e r x = 0 {\displaystyle v''(x)e^{rx}=0} v''(x)e^{{rx}}=0 Example 2.2. Suppose we were working with the equation below, which has the repeated root r = − 4. {\displaystyle r=-4.} r=-4. Our substitution then fortuitously cancels most of the terms. d 2 y d x 2 + 8 d y d x + 16 y = 0 {\displaystyle {\frac {\mathrm {d} ^{2}y}{\mathrm {d} x^{2}}}+8{\frac {\mathrm {d} y}{\mathrm {d} x}}+16y=0} {\frac {{\mathrm {d}}^{{2}}y}{{\mathrm {d}}x^{{2}}}}+8{\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+16y=0 y = v ( x ) e − 4 x y ′ = v ′ ( x ) e − 4 x − 4 v ( x ) e − 4 x y ″ = v ″ ( x ) e − 4 x − 8 v ′ ( x ) e − 4 x + 16 v ( x ) e − 4 x {\displaystyle {\begin{aligned}y&=v(x)e^{-4x}\\y'&=v'(x)e^{-4x}-4v(x)e^{-4x}\\y''&=v''(x)e^{-4x}-8v'(x)e^{-4x}+16v(x)e^{-4x}\end{aligned}}} {\begin{aligned}y&=v(x)e^{{-4x}}\\y'&=v'(x)e^{{-4x}}-4v(x)e^{{-4x}}\\y''&=v''(x)e^{{-4x}}-8v'(x)e^{{-4x}}+16v(x)e^{{-4x}}\end{aligned}} v ″ e − 4 x − 8 v ′ e − 4 x + 16 v e − 4 x + 8 v ′ e − 4 x − 32 v e − 4 x + 16 v e − 4 x = 0 {\displaystyle {\begin{aligned}v''e^{-4x}&-{\cancel {8v'e^{-4x}}}+{\cancel {16ve^{-4x}}}\\&+{\cancel {8v'e^{-4x}}}-{\cancel {32ve^{-4x}}}+{\cancel {16ve^{-4x}}}=0\end{aligned}}} {\begin{aligned}v''e^{{-4x}}&-{\cancel {8v'e^{{-4x}}}}+{\cancel {16ve^{{-4x}}}}\\&+{\cancel {8v'e^{{-4x}}}}-{\cancel {32ve^{{-4x}}}}+{\cancel {16ve^{{-4x}}}}=0\end{aligned}} Much like our ansatz for the differential equation with constant coefficients, only the second derivative can be 0 here. Integrating twice leads to the desired expression for v . {\displaystyle v.} v. v ( x ) = c 1 + c 2 x {\displaystyle v(x)=c_{1}+c_{2}x} v(x)=c_{{1}}+c_{{2}}x The general solution to the differential equation with constant coefficients given repeated roots in its characteristic equation can then be written like so. As a handy way of remembering, one merely multiply the second term with an x {\displaystyle x} x to achieve linear independence. Because this set is linearly independent, we have found all the solutions to this equation, and are done. y ( x ) = ( c 1 + c 2 x ) e r x {\displaystyle y(x)=(c_{1}+c_{2}x)e^{rx}} y(x)=(c_{{1}}+c_{{2}}x)e^{{rx}} d 2 y d x 2 + p ( x ) d y d x + q ( x ) y = 0. {\displaystyle {\frac {\mathrm {d} ^{2}y}{\mathrm {d} x^{2}}}+p(x){\frac {\mathrm {d} y}{\mathrm {d} x}}+q(x)y=0.} {\frac {{\mathrm {d}}^{{2}}y}{{\mathrm {d}}x^{{2}}}}+p(x){\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+q(x)y=0. Reduction of order applies if we know a solution y 1 ( x ) {\displaystyle y_{1}(x)} y_{{1}}(x) to this equation, whether found by chance or given in a problem. We look for a solution of the form y ( x ) = v ( x ) y 1 ( x ) {\displaystyle y(x)=v(x)y_{1}(x)} y(x)=v(x)y_{{1}}(x) and proceed to substitute this into the equation. v ″ y 1 + 2 v ′ y 1 ′ + p ( x ) v ′ y 1 + v ( y 1 ″ + p ( x ) y 1 ′ + q ( x ) ) = 0 {\displaystyle v''y_{1}+2v'y_{1}'+p(x)v'y_{1}+v(y_{1}''+p(x)y_{1}'+q(x))=0} v''y_{{1}}+2v'y_{{1}}'+p(x)v'y_{{1}}+v(y_{{1}}''+p(x)y_{{1}}'+q(x))=0 Because y 1 {\displaystyle y_{1}} y_{{1}} is already a solution to the differential equation, the terms with v {\displaystyle v} v all vanish. What remains is a linear, first-order equation. To see this more clearly, make the change of variables w ( x ) = v ′ ( x ) . {\displaystyle w(x)=v'(x).} w(x)=v'(x). y 1 w ′ + ( 2 y 1 ′ + p ( x ) y 1 ) w = 0 {\displaystyle y_{1}w'+(2y_{1}'+p(x)y_{1})w=0} y_{{1}}w'+(2y_{{1}}'+p(x)y_{{1}})w=0 w ( x ) = exp ⁡ ( ∫ ( 2 y 1 ′ ( x ) y 1 ( x ) + p ( x ) ) d x ) {\displaystyle w(x)=\exp \left(\int \left({\frac {2y_{1}'(x)}{y_{1}(x)}}+p(x)\right)\mathrm {d} x\right)} w(x)=\exp \left(\int \left({\frac {2y_{{1}}'(x)}{y_{{1}}(x)}}+p(x)\right){\mathrm {d}}x\right) v ( x ) = ∫ w ( x ) d x {\displaystyle v(x)=\int w(x)\mathrm {d} x} v(x)=\int w(x){\mathrm {d}}x If the integrals can be done, then one would obtain the general solution in terms of elementary functions. If not, then the solution can be left in integral form.

Euler-Cauchy equation. The Euler-Cauchy equation is a specific example of a second-order differential equation with variable coefficients that contain exact solutions. This equation is seen in some applications, such as when solving Laplace's equation in spherical coordinates. x 2 d 2 y d x 2 + a x d y d x + b y = 0 {\displaystyle x^{2}{\frac {\mathrm {d} ^{2}y}{\mathrm {d} x^{2}}}+ax{\frac {\mathrm {d} y}{\mathrm {d} x}}+by=0} x^{{2}}{\frac {{\mathrm {d}}^{{2}}y}{{\mathrm {d}}x^{{2}}}}+ax{\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+by=0 Characteristic equation. The structure of this differential equation is such that each term is multiplied by a power term whose degree is equal to the order of the derivative. This suggests that we try the ansatz y ( x ) = x n , {\displaystyle y(x)=x^{n},} y(x)=x^{{n}}, where n {\displaystyle n} n is yet to be determined, in a similar manner as trying the exponential function in dealing with the linear differential equation with constant coefficients. After differentiating and substituting, we obtain the following. x n ( n 2 + ( a − 1 ) n + b ) = 0 {\displaystyle x^{n}(n^{2}+(a-1)n+b)=0} x^{{n}}(n^{{2}}+(a-1)n+b)=0 Here, we must assume that x ≠ 0 {\displaystyle x\neq 0} x\neq 0 in order for us to use the characteristic equation. The point x = 0 {\displaystyle x=0} x=0 is called a regular singular point of the differential equation, a property that becomes important when solving differential equations using power series. This equation has two roots, which may be real and distinct, repeated, or complex conjugates. n ± = 1 − a ± ( a − 1 ) 2 − 4 b 2 {\displaystyle n_{\pm }={\frac {1-a\pm {\sqrt {(a-1)^{2}-4b}}}{2}}} n_{{\pm }}={\frac {1-a\pm {\sqrt {(a-1)^{{2}}-4b}}}{2}} Two real and distinct roots. If n ± {\displaystyle n_{\pm }} n_{{\pm }} are both real and are distinct, then the solution to the differential equation is given below. y ( x ) = c 1 x n + + c 2 x n − {\displaystyle y(x)=c_{1}x^{n_{+}}+c_{2}x^{n_{-}}} y(x)=c_{{1}}x^{{n_{{+}}}}+c_{{2}}x^{{n_{{-}}}} Two complex roots. If n ± = α ± β i {\displaystyle n_{\pm }=\alpha \pm \beta i} n_{{\pm }}=\alpha \pm \beta i are the roots to the characteristic equation, then we obtain a complex function as our solution. To convert this into a real function, we make the change of variables x = e t , {\displaystyle x=e^{t},} x=e^{{t}}, implying t = ln ⁡ x , {\displaystyle t=\ln x,} t=\ln x, and use Euler's formula. A similar process is conducted as before in reassigning arbitrary constants. y ( t ) = e α t ( c 1 e β i t + c 2 e − β i t ) {\displaystyle y(t)=e^{\alpha t}(c_{1}e^{\beta it}+c_{2}e^{-\beta it})} y(t)=e^{{\alpha t}}(c_{{1}}e^{{\beta it}}+c_{{2}}e^{{-\beta it}}) The general solution can then be written as follows. y ( x ) = x α ( c 1 cos ⁡ ( β ln ⁡ x ) + c 2 sin ⁡ ( β ln ⁡ x ) ) {\displaystyle y(x)=x^{\alpha }(c_{1}\cos(\beta \ln x)+c_{2}\sin(\beta \ln x))} y(x)=x^{{\alpha }}(c_{{1}}\cos(\beta \ln x)+c_{{2}}\sin(\beta \ln x)) Repeated roots. To obtain the second linearly independent solution, we must use reduction of order again. There is much algebra involved, but the concept remains the same: we substitute y = v ( x ) y 1 {\displaystyle y=v(x)y_{1}} y=v(x)y_{{1}} into the equation, where y 1 {\displaystyle y_{1}} y_{{1}} is the first solution. Terms will cancel, and we are left with the following equation. v ″ + 1 x v ′ = 0 {\displaystyle v''+{\frac {1}{x}}v'=0} v''+{\frac {1}{x}}v'=0 This is a linear first-order equation in v ′ ( x ) . {\displaystyle v'(x).} v'(x). Its solution is v ( x ) = c 1 + c 2 ln ⁡ x . {\displaystyle v(x)=c_{1}+c_{2}\ln x.} v(x)=c_{{1}}+c_{{2}}\ln x. Our answer can therefore be written as follows. An easy way to remember this solution is that the second linearly independent solution merely needs an extra ln ⁡ x {\displaystyle \ln x} \ln x term. y ( x ) = x n ( c 1 + c 2 ln ⁡ x ) {\displaystyle y(x)=x^{n}(c_{1}+c_{2}\ln x)} y(x)=x^{{n}}(c_{{1}}+c_{{2}}\ln x)

Inhomogeneous linear differential equations with constant coefficients. The inhomogeneous case deals with the equation L [ y ( x ) ] = f ( x ) , {\displaystyle L[y(x)]=f(x),} L[y(x)]=f(x), where f ( x ) {\displaystyle f(x)} f(x) is called the source term. According to the theory of differential equations, the general solution to this equation is the superposition of the particular solution y p ( x ) {\displaystyle y_{p}(x)} y_{{p}}(x) and the complementary solution y c ( x ) . {\displaystyle y_{c}(x).} y_{{c}}(x). The particular solution here, confusingly, refers not to a solution given initial conditions, but rather the solution that exists as a result of the inhomogeneous term. The complementary solution refers to the solution of the corresponding homogeneous differential equation by setting f ( x ) = 0. {\displaystyle f(x)=0.} f(x)=0. We may show that the general solution is a superposition of these two solutions by writing L [ y p + y c ] = L [ y p ] + L [ y c ] = f ( x ) {\displaystyle L[y_{p}+y_{c}]=L[y_{p}]+L[y_{c}]=f(x)} L[y_{{p}}+y_{{c}}]=L[y_{{p}}]+L[y_{{c}}]=f(x) and noting that because L [ y c ] = 0 , {\displaystyle L[y_{c}]=0,} L[y_{{c}}]=0, this superposition is indeed the general solution. d 2 y d x 2 + a d y d x + b y = f ( x ) {\displaystyle {\frac {\mathrm {d} ^{2}y}{\mathrm {d} x^{2}}}+a{\frac {\mathrm {d} y}{\mathrm {d} x}}+by=f(x)} {\frac {{\mathrm {d}}^{{2}}y}{{\mathrm {d}}x^{{2}}}}+a{\frac {{\mathrm {d}}y}{{\mathrm {d}}x}}+by=f(x) Method of undetermined coefficients. The method of undetermined coefficients is a method that works when the source term is some combination of exponential, trigonometric, hyperbolic, or power terms. These terms are the only terms that have a finitely many number of linearly independent derivatives. In this section, we concentrate on finding the particular solution. Compare the terms in f ( x ) {\displaystyle f(x)} f(x) with the terms in y c , {\displaystyle y_{c},} y_{{c}}, disregarding multiplicative constants. There are three cases. None of the terms are the same. The particular solution y p {\displaystyle y_{p}} y_{{p}} will then consist of a linear combination of the terms in y p {\displaystyle y_{p}} y_{{p}} and their linearly independent derivatives. f ( x ) {\displaystyle f(x)} f(x) contains a term h ( x ) {\displaystyle h(x)} h(x) that is x n {\displaystyle x^{n}} x^{{n}} times a term in y c , {\displaystyle y_{c},} y_{{c}}, where n {\displaystyle n} n is 0 or a positive integer, but this term originated from a distinct root of the characteristic equation. In this case, y p {\displaystyle y_{p}} y_{{p}} will consist of a linear combination of x n + 1 h ( x ) , {\displaystyle x^{n+1}h(x),} x^{{n+1}}h(x), its linearly independent derivatives, as well as the other terms of f ( x ) {\displaystyle f(x)} f(x) and their linearly independent derivatives. f ( x ) {\displaystyle f(x)} f(x) contains a term h ( x ) {\displaystyle h(x)} h(x) that is x n {\displaystyle x^{n}} x^{{n}} times a term in y c , {\displaystyle y_{c},} y_{{c}}, where n {\displaystyle n} n is 0 or a positive integer, but this term originated from a repeated root of the characteristic equation. In this case, y p {\displaystyle y_{p}} y_{{p}} will consist of a linear combination of x n + s h ( x ) {\displaystyle x^{n+s}h(x)} x^{{n+s}}h(x) (where s {\displaystyle s} s is the multiplicity of the root) and its linearly independent derivatives, as well as the other terms of f ( x ) {\displaystyle f(x)} f(x) and their linearly independent derivatives. Write out y p {\displaystyle y_{p}} y_{{p}} as a linear combination of the aforementioned terms. The coefficients in this linear combination refer to the namesake of "undetermined coefficients." If terms that are in y c {\displaystyle y_{c}} y_{{c}} appear, they may be discarded because of the presence of the arbitrary constants in y c . {\displaystyle y_{c}.} y_{{c}}. Once written out, substitute y p {\displaystyle y_{p}} y_{{p}} into the equation and equate like terms. Solve for the coefficients. In general, one encounters a system of algebraic equations at this point, but this system is usually not too difficult to solve. Once found, y p {\displaystyle y_{p}} y_{{p}} is found, and we are done. Example 2.3. The following differential equation is an inhomogeneous differential equation with a source term that contains a finitely many number of linearly independent derivatives. Hence we may use the method of undetermined coefficients to find its particular solution. d 2 y d t 2 + 6 y = 2 e 3 t − cos ⁡ 5 t {\displaystyle {\frac {\mathrm {d} ^{2}y}{\mathrm {d} t^{2}}}+6y=2e^{3t}-\cos 5t} {\frac {{\mathrm {d}}^{{2}}y}{{\mathrm {d}}t^{{2}}}}+6y=2e^{{3t}}-\cos 5t y c ( t ) = c 1 cos ⁡ 6 t + c 2 sin ⁡ 6 t {\displaystyle y_{c}(t)=c_{1}\cos {\sqrt {6}}t+c_{2}\sin {\sqrt {6}}t} y_{{c}}(t)=c_{{1}}\cos {\sqrt {6}}t+c_{{2}}\sin {\sqrt {6}}t y p ( t ) = A e 3 t + B cos ⁡ 5 t + C sin ⁡ 5 t {\displaystyle y_{p}(t)=Ae^{3t}+B\cos 5t+C\sin 5t} y_{{p}}(t)=Ae^{{3t}}+B\cos 5t+C\sin 5t 9 A e 3 t − 25 B cos ⁡ 5 t − 25 C sin ⁡ 5 t + 6 A e 3 t + 6 B cos ⁡ 5 t + 6 C sin ⁡ 5 t = 2 e 3 t − cos ⁡ 5 t {\displaystyle {\begin{aligned}9Ae^{3t}-25B\cos 5t&-25C\sin 5t+6Ae^{3t}\\&+6B\cos 5t+6C\sin 5t=2e^{3t}-\cos 5t\end{aligned}}} {\begin{aligned}9Ae^{{3t}}-25B\cos 5t&-25C\sin 5t+6Ae^{{3t}}\\&+6B\cos 5t+6C\sin 5t=2e^{{3t}}-\cos 5t\end{aligned}} { 9 A + 6 A = 2 , A = 2 15 − 25 B + 6 B = − 1 , B = 1 19 − 25 C + 6 C = 0 , C = 0 {\displaystyle {\begin{cases}9A+6A=2,&A={\dfrac {2}{15}}\\-25B+6B=-1,&B={\dfrac {1}{19}}\\-25C+6C=0,&C=0\end{cases}}} {\begin{cases}9A+6A=2,&A={\dfrac {2}{15}}\\-25B+6B=-1,&B={\dfrac {1}{19}}\\-25C+6C=0,&C=0\end{cases}} y ( t ) = c 1 cos ⁡ 6 t + c 2 sin ⁡ 6 t + 2 15 e 3 t + 1 19 cos ⁡ 5 t {\displaystyle y(t)=c_{1}\cos {\sqrt {6}}t+c_{2}\sin {\sqrt {6}}t+{\frac {2}{15}}e^{3t}+{\frac {1}{19}}\cos 5t} y(t)=c_{{1}}\cos {\sqrt {6}}t+c_{{2}}\sin {\sqrt {6}}t+{\frac {2}{15}}e^{{3t}}+{\frac {1}{19}}\cos 5t Variation of parameters. Variation of parameters is a more general method of solving inhomogeneous differential equations, particularly when the source term does not contain a finitely many number of linearly independent derivatives. Source terms like tan ⁡ x {\displaystyle \tan x} \tan x and x − n {\displaystyle x^{-n}} x^{{-n}} warrant the use of variation of parameters to find the particular solution. Variation of parameters may even be used to solve differential equations with variable coefficients, though with the exception of the Euler-Cauchy equation, this is less common because the complementary solution is typically not written in terms of elementary functions. Assume a solution of the form below. Its derivative is written on the second line. y ( x ) = v 1 ( x ) y 1 ( x ) + v 2 ( x ) y 2 ( x ) {\displaystyle y(x)=v_{1}(x)y_{1}(x)+v_{2}(x)y_{2}(x)} y(x)=v_{{1}}(x)y_{{1}}(x)+v_{{2}}(x)y_{{2}}(x) y ′ = v 1 ′ y 1 + v 1 y 1 ′ + v 2 ′ y 2 + v 2 y 2 ′ {\displaystyle y'=v_{1}'y_{1}+v_{1}y_{1}'+v_{2}'y_{2}+v_{2}y_{2}'} y'=v_{{1}}'y_{{1}}+v_{{1}}y_{{1}}'+v_{{2}}'y_{{2}}+v_{{2}}y_{{2}}' Because the assumed solution is of a form in which there are two unknowns, yet there is only one equation, we must also impose an auxiliary condition. We choose the following auxiliary condition. v 1 ′ y 1 + v 2 ′ y 2 = 0 {\displaystyle v_{1}'y_{1}+v_{2}'y_{2}=0} v_{{1}}'y_{{1}}+v_{{2}}'y_{{2}}=0 y ′ = v 1 y 1 ′ + v 2 y 2 ′ {\displaystyle y'=v_{1}y_{1}'+v_{2}y_{2}'} y'=v_{{1}}y_{{1}}'+v_{{2}}y_{{2}}' y ″ = v 1 ′ y 1 ′ + v 1 y 1 ″ + v 2 ′ y 2 ′ + v 2 y 2 ″ {\displaystyle y''=v_{1}'y_{1}'+v_{1}y_{1}''+v_{2}'y_{2}'+v_{2}y_{2}''} y''=v_{{1}}'y_{{1}}'+v_{{1}}y_{{1}}''+v_{{2}}'y_{{2}}'+v_{{2}}y_{{2}}'' Now we proceed to obtain the second equation. After substituting and rearranging terms, we can group terms containing v 1 {\displaystyle v_{1}} v_{{1}} together and terms containing v 2 {\displaystyle v_{2}} v_{{2}} together. These terms all cancel because y 1 {\displaystyle y_{1}} y_{{1}} and y 2 {\displaystyle y_{2}} y_{{2}} are solutions to the corresponding homogeneous equation. We are then left with the following system of equations. v 1 ′ y 1 + v 2 ′ y 2 = 0 v 1 ′ y 1 ′ + v 2 ′ y 2 ′ = f ( x ) {\displaystyle {\begin{aligned}v_{1}'y_{1}+v_{2}'y_{2}&=0\\v_{1}'y_{1}'+v_{2}'y_{2}'&=f(x)\\\end{aligned}}} {\begin{aligned}v_{{1}}'y_{{1}}+v_{{2}}'y_{{2}}&=0\\v_{{1}}'y_{{1}}'+v_{{2}}'y_{{2}}'&=f(x)\\\end{aligned}} This system can be rearranged into a matrix equation of the form A x = b , {\displaystyle A\mathbf {x} =\mathbf {b} ,} A{\mathbf {x}}={\mathbf {b}}, whose solution is x = A − 1 b . {\displaystyle \mathbf {x} =A^{-1}\mathbf {b} .} {\mathbf {x}}=A^{{-1}}{\mathbf {b}}. The inverse of a 2 × 2 {\displaystyle 2\times 2} 2\times 2 matrix is found by dividing by the determinant, swapping the diagonal elements, and negating the off-diagonal elements. The determinant of this matrix is, in fact, the Wronskian. ( v 1 ′ v 2 ′ ) = 1 W ( y 2 ′ − y 2 − y 1 ′ y 1 ) ( 0 f ( x ) ) {\displaystyle {\begin{pmatrix}v_{1}'\\v_{2}'\end{pmatrix}}={\frac {1}{W}}{\begin{pmatrix}y_{2}'&-y_{2}\\-y_{1}'&y_{1}\end{pmatrix}}{\begin{pmatrix}0\\f(x)\end{pmatrix}}} {\begin{pmatrix}v_{{1}}'\\v_{{2}}'\end{pmatrix}}={\frac {1}{W}}{\begin{pmatrix}y_{{2}}'&-y_{{2}}\\-y_{{1}}'&y_{{1}}\end{pmatrix}}{\begin{pmatrix}0\\f(x)\end{pmatrix}} The formulas for v 1 {\displaystyle v_{1}} v_{{1}} and v 2 {\displaystyle v_{2}} v_{{2}} are given below. Just like in reduction of order, the integration here introduces an arbitrary constant that incorporates the complementary solution into the general solution of the differential equation. v 1 ( x ) = − ∫ 1 W f ( x ) y 2 ( x ) d x {\displaystyle v_{1}(x)=-\int {\frac {1}{W}}f(x)y_{2}(x)\mathrm {d} x} v_{{1}}(x)=-\int {\frac {1}{W}}f(x)y_{{2}}(x){\mathrm {d}}x v 2 ( x ) = ∫ 1 W f ( x ) y 1 ( x ) d x {\displaystyle v_{2}(x)=\int {\frac {1}{W}}f(x)y_{1}(x)\mathrm {d} x} v_{{2}}(x)=\int {\frac {1}{W}}f(x)y_{{1}}(x){\mathrm {d}}x

Original news source

What's your reaction?

Comments

https://chuka-chuka.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!