# Talk:Variation of parameters

WikiProject Mathematics (Rated C-class, Mid-importance)
This article is within the scope of WikiProject Mathematics, a collaborative effort to improve the coverage of Mathematics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Mathematics rating:
 C Class
 Mid Importance
Field:  Analysis

## Example

In the first example, it says "So, we obtain u1=e-2x, and u2=xe-2x." This is in my text too, but I never understood why. Could someone add a short comment saying why (e.g. "So, we obtain u1=e^-2x (see blahs_rule) and we introduce an x term (see blah2s_rule) as well to yield u2=xe^-2x"). 75.128.252.106 (talk) 03:50, 8 February 2008 (UTC)

## Using this for first-order ODEs

Can't this also be used for 1st order ODE's? Perhaps I'm thinking of a different method, but I was just looking at my Differential Equations Text, and the method seems the same, except for first order equations. Any thoughts? Gershwinrb 06:34, 1 February 2006 (UTC)

Any first-order linear ODE can be solved with little fuss — see Ordinary differential equation#General solution method for first-order linear ODEs — such that techniques like the method of variation of parameters are unnecessary. Ruakh 15:29, 1 February 2006 (UTC)
It should be noted that variation of parameters does work for first order ODE just as it does for 2nd order and higher. But you are correct that conceptually easier techniques are available there.163.118.103.199 (talk) 18:34, 5 March 2012 (UTC)

Should we also have examples for systems of equations and/or higher order ODEs? jleto

## u is homogenous solution?

In the beginning of the Technique section, the article says ${\displaystyle u_{1}}$ and ${\displaystyle u_{2}}$ are "solutions" to the equation. It really means solutions to the homogenous equation, right? If not, I'm totally confused. This should be changed and made clear. Lavaka 05:32, 15 September 2006 (UTC)

Good call. I've fixed the article now. Ruakh 13:30, 15 September 2006 (UTC)
Thanks! Lavaka 01:55, 20 September 2006 (UTC)

## Copy from Ordinary differential equation

I deleted the following text from the Ordinary differential equation where it consumed far too much space. I copied it here in case anyone is able to salvage some parts and integrate them into this article. MathMartin 20:24, 11 December 2006 (UTC)

### Method of variation of parameters

As explained above, the general solution to a non-homogeneous, linear differential equation ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=g(x)}$ can be expressed as the sum of the general solution ${\displaystyle y_{h}(x)}$ to the corresponding homogenous, linear differential equation ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=0}$ and any one solution ${\displaystyle y_{p}(x)}$ to ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=g(x)}$.

Like the method of undetermined coefficients, described above, the method of variation of parameters is a method for finding one solution to ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=g(x)}$, having already found the general solution to ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=0}$. Unlike the method of undetermined coefficients, which fails except with certain specific forms of g(x), the method of variation of parameters will always work; however, it is significantly more difficult to use.

For a second-order equation, the method of variation of parameters makes use of the following fact:

##### Fact

Let p(x), q(x), and g(x) be functions, and let ${\displaystyle y_{1}(x)}$ and ${\displaystyle y_{2}(x)}$ be solutions to the homogeneous, linear differential equation ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=0}$. Further, let u(x) and v(x) be functions such that ${\displaystyle u'(x)y_{1}(x)+v'(x)y_{2}(x)=0}$ and ${\displaystyle u'(x)y_{1}'(x)+v'(x)y_{2}'(x)=g(x)}$ for all x, and define ${\displaystyle y_{p}(x)=u(x)y_{1}(x)+v(x)y_{2}(x)}$. Then ${\displaystyle y_{p}(x)}$ is a solution to the non-homogeneous, linear differential equation ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=g(x)}$.

##### Proof

${\displaystyle y_{p}(x)=u(x)y_{1}(x)+v(x)y_{2}(x)}$

 ${\displaystyle y_{p}'(x)}$ ${\displaystyle =u'(x)y_{1}(x)+u(x)y_{1}'(x)+v'(x)y_{2}(x)+v(x)y_{2}'(x)}$ ${\displaystyle =0+u(x)y_{1}'(x)+v(x)y_{2}'(x)}$
 ${\displaystyle y_{p}''(x)}$ ${\displaystyle =u'(x)y_{1}'(x)+u(x)y_{1}''(x)+v'(x)y_{2}'(x)+v(x)y_{2}''(x)}$ ${\displaystyle =g(x)+u(x)y_{1}''(x)+v(x)y_{2}''(x)}$

${\displaystyle y_{p}''(x)+p(x)y'_{p}(x)+q(x)y_{p}(x)=g(x)+u(x)y_{1}''(x)+v(x)y_{2}''(x)+p(x)u(x)y_{1}'(x)+p(x)v(x)y_{2}'(x)+q(x)u(x)y_{1}(x)+q(x)v(x)y_{2}(x)}$

${\displaystyle =g(x)+u(x)(y_{1}''(x)+p(x)y_{1}'(x)+q(x)y_{1}(x))+v(x)(y_{2}''(x)+p(x)y_{2}'(x)+q(x)y_{2}(x))=g(x)+0+0=g(x)}$

##### Usage

To solve the second-order, non-homogeneous, linear differential equation ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=g(x)}$ using the method of variation of parameters, use the following steps:

1. Find the general solution to the corresponding homogeneous equation ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=0}$. Specifically, find two linearly independent solutions ${\displaystyle y_{1}(x)}$ and ${\displaystyle y_{2}(x)}$.
2. Since ${\displaystyle y_{1}(x)}$ and ${\displaystyle y_{2}(x)}$ are linearly independent solutions, their Wronskian ${\displaystyle y_{1}(x)y_{2}'(x)-y_{1}'(x)y_{2}(x)}$ is nonzero, so we can compute ${\displaystyle -(g(x)y_{2}(x))/({y_{1}(x)y_{2}'(x)-y_{1}'(x)y_{2}(x)})}$ and ${\displaystyle ({g(x)y_{1}(x)})/({y_{1}(x)y_{2}'(x)-y_{1}'(x)y_{2}(x)})}$. If the former is equal to u'(x) and the latter to v'(x), then u and v satisfy the two constraints given above: that ${\displaystyle u'(x)y_{1}(x)+v'(x)y_{2}(x)=0}$ and that ${\displaystyle u'(x)y_{1}'(x)+v'(x)y_{2}'(x)=g(x)}$. We can tell this after multiplying by the denominator and comparing coefficients.
3. Integrate ${\displaystyle -(g(x)y_{2}(x))/({y_{1}(x)y_{2}'(x)-y_{1}'(x)y_{2}(x)})}$ and ${\displaystyle ({g(x)y_{1}(x)})/({y_{1}(x)y_{2}'(x)-y_{1}'(x)y_{2}(x)})}$ to obtain u(x) and v(x), respectively. (Note that we only need one choice of u and v, so there is no need for constants of integration.)
4. Compute ${\displaystyle y_{p}(x)=u(x)y_{1}(x)+v(x)y_{2}(x)}$. The function ${\displaystyle y_{p}}$ is one solution of ${\displaystyle y''(x)+p(x)y'(x)+q(x)y(x)=g(x)}$.
5. The general solution is ${\displaystyle c_{1}y_{1}(x)+c_{2}y_{2}(x)+y_{p}(x)}$, where ${\displaystyle c_{1}}$ and ${\displaystyle c_{2}}$ are arbitrary constants.
##### Higher-order equations

The method of variation of parameters can also be used with higher-order equations. For example, if ${\displaystyle y_{1}(x)}$, ${\displaystyle y_{2}(x)}$, and ${\displaystyle y_{3}(x)}$ are linearly independent solutions to ${\displaystyle y'''(x)+p(x)y''(x)+q(x)y'(x)+r(x)y(x)=0}$, then there exist functions u(x), v(x), and w(x) such that ${\displaystyle u'(x)y_{1}(x)+v'(x)y_{2}(x)+w'(x)y_{3}(x)=0}$, ${\displaystyle u'(x)y_{1}'(x)+v'(x)y_{2}'(x)+w'(x)y_{3}'(x)=0}$, and ${\displaystyle u'(x)y_{1}''(x)+v'(x)y_{2}''(x)+w'(x)y_{3}''(x)=g(x)}$. Having found such functions (by solving algebraically for u'(x), v'(x), and w'(x), then integrating each), we have ${\displaystyle y_{p}(x)=u(x)y_{1}(x)+v(x)y_{2}(x)+w(x)y_{3}(x)}$, one solution to the equation ${\displaystyle y'''(x)+p(x)y''(x)+q(x)y'(x)+r(x)y(x)=g(x)}$.

##### Example

Solve the previous example, ${\displaystyle y''+y=\sec x}$ Recall ${\displaystyle \sec x={\frac {1}{\cos x}}=f}$. From technique learned from 3.1, LHS has root of ${\displaystyle r=\pm i}$ that yield ${\displaystyle y_{c}=C_{1}\cos x+C_{2}\sin x}$, (so ${\displaystyle y_{1}=\cos x}$, ${\displaystyle y_{2}=\sin x}$ ) and its derivatives

${\displaystyle \left\{{\begin{matrix}{{\dot {u}}={\frac {-y_{2}f}{W}}={\frac {-\sin x}{\cos x}}=\tan x}\\{{\dot {v}}={\frac {y_{1}f}{W}}={\frac {\cos x}{\cos x}}=1}\\\end{matrix}}\right.}$

where the Wronskian

${\displaystyle W\left({y_{1},y_{2}:x}\right)=\left|{\begin{matrix}{\cos x}&{\sin x}\\{-\sin x}&{\cos x}\\\end{matrix}}\right|=1}$

were computed in order to seek solution to its derivatives.

Upon integration,

${\displaystyle \left\{{\begin{matrix}u=-\int {\tan x\,dx=-\ln \left|{\sec x}\right|+C}\\v=\int {1\,dx=x+C}\\\end{matrix}}\right.}$

Computing ${\displaystyle y_{p}}$ and ${\displaystyle y_{G}}$:

${\displaystyle {\begin{matrix}y_{p}=f=uy_{1}+vy_{2}=\cos x\ln \left|{\cos x}\right|+x\sin x\\y_{G}=y_{c}+y_{p}=C_{1}\cos x+C_{2}\sin x+x\sin x+\cos x\ln \left({\cos x}\right)\\\end{matrix}}}$

## Wrong Equation

In the fith equation of the section Method_of_variation_of_parameters#Method_of_variation_of_parameters it should be "b(x)" rather than "-b(x)". But i am not completely sure. —The preceding unsigned comment was added by 141.35.186.111 (talkcontribs) 13:33, 2 February 2007 (UTC).

## Integrals and dummy variables

I think the integrals should be changed to use dummy variables -- as written now, they are misleading. The current format is ${\displaystyle \int cos(x)dx=sin(x)}$ but I'd much rather see a dummy variable, e.g. ${\displaystyle \int _{0}^{x}cos(s)ds=sin(x)-sin(0)}$ or at least ${\displaystyle \int cos(x)ds=sin(x)}$ Anyone interested in redoing this? --Lavaka 18:20, 17 April 2007 (UTC)

and I think
${\displaystyle c_{i}^{'}(x)={\frac {b(y)W_{i}(x)}{W(y)}}\,\mathrm {,} \quad i=1,\ldots ,n}$
should be
${\displaystyle c_{i}^{'}(x)={\frac {b(y)W_{i}(x)}{W(x)}}\,\mathrm {,} \quad i=1,\ldots ,n}$
as well, no? --Lavaka 18:27, 17 April 2007 (UTC)
actually, the ${\displaystyle W(y)}$ is a constant, no? This should be made clear, and written ${\displaystyle W}$ --Lavaka 18:47, 17 April 2007 (UTC)
The current format is just the typical representation of indefinite integral. I can't see any problem with it.129.94.223.121 (talk) —Preceding undated comment added 01:18, 24 August 2009 (UTC).

## Mistake in the First Example

The first example calculation involves an integral containing ${\displaystyle f(x)}$,

${\displaystyle A(x)=-\int {1 \over W}u_{2}(x)f(x)\,dx,\;B(x)=\int {1 \over W}u_{1}(x)f(x)\,dx}$

Nowhere up to this point is ${\displaystyle f(x)}$ defined; in fact (it refers to the right-hand-side of the ODE) the function on the right-hand-side has previously been called ${\displaystyle b(x)}$. —Preceding unsigned comment added by 68.49.223.78 (talk) 14:57, 8 March 2010 (UTC)

## Annotation regarding coefficient-functions

I am not sure, whether the statement in parenthesis is 100% correct.

${\displaystyle c_{i}(x)}$ are continuous functions which satisfy the equations
${\displaystyle \sum _{i=1}^{n}c_{i}^{'}(x)y_{i}^{(j)}(x)=0\,\mathrm {,} \quad j=0,\ldots ,n-2}$ (iv)

(results from substitution of (iii) into the homogeneous case (ii); )

How is one supposed to conclude this from the described substitution?? —Preceding unsigned comment added by 93.104.136.99 (talk) 14:47, 19 September 2010 (UTC)

You are right, that part is assumed, not computed. I changed it.
99.126.180.28 (talk) 22:36, 2 February 2011 (UTC)

## Why?

why equation 3 is true? Please tell, if you know, and have some time. eq 2 looks like definition of null space, and the y sub i forms a basis of the null space, a subspace of the vector space of — Preceding unsigned comment added by 108.236.198.181 (talk) 23:34, 2 June 2013 (UTC)

## Newton's law and variation of parameters

It seems to me that someone should write a brief motivation (for second order ODEs) of the method via Newton's law. The left-hand side of a nonhomogeneous second-order ODE

${\displaystyle mx''+\mu x+kx=b(t)}$

is the net force on a mass attached to a damped spring. The right-hand side is the external force applied to the spring. The method of variation of parameters is nothing more than cumulatively adding to the solution during each time interval ${\displaystyle [t,t+dt]}$ the effect of imparting an additional momentum ${\displaystyle b(t)dt}$ to the mass. It would be nice if someone could track down a reference for this (and hopefully a clearer explanation) and add it to the article. The same essential idea applies more generally to Duhamel's principle. Sławomir Biały (talk) 18:42, 24 June 2013 (UTC)

Also the matrix formulation of variation of parameters is conspicuously absent from the article. Sławomir Biały (talk) 18:45, 24 June 2013 (UTC)

## Merge content from Duhamel's principle

All the references I could find that mentioned both variation of parameters and Duhamel's principle said they were equivalent. Even the variation of parameters article says that they're related. I tried tracking down the source of "Duhamel's principle" and they just mention the superposition principle (again something done in variation of parameters). Variation of parameters seems like the more common term in overall usage. --Mathnerd314159 (talk) 05:50, 7 April 2017 (UTC)