Constant variation method online calculator. ODE
The method of variation of an arbitrary constant, or the Lagrange method, is another way to solve first-order linear differential equations and the Bernoulli equation.
Linear differential equations of the first order are equations of the form y’+p(x)y=q(x). If the right side is zero: y’+p(x)y=0, then this is a linear homogeneous 1st order equation. Accordingly, the equation with a non-zero right side, y’+p(x)y=q(x), — heterogeneous linear equation of the 1st order.
Arbitrary constant variation method (Lagrange method) consists of the following:
1) We are looking for a general solution to the homogeneous equation y’+p(x)y=0: y=y*.
2) In the general solution, C is considered not a constant, but a function of x: C=C(x). We find the derivative of the general solution (y*)' and substitute the resulting expression for y* and (y*)' into the initial condition. From the resulting equation, we find the function С(x).
3) In the general solution of the homogeneous equation, instead of C, we substitute the found expression C (x).
Consider examples on the method of variation of an arbitrary constant. Let's take the same tasks as in , compare the course of the solution and make sure that the answers received are the same.
1) y'=3x-y/x
Let's rewrite the equation in standard form (in contrast to the Bernoulli method, where we needed the notation only to see that the equation is linear).
y'+y/x=3x (I). Now we are going according to plan.
1) We solve the homogeneous equation y’+y/x=0. This is a separable variable equation. Represent y’=dy/dx, substitute: dy/dx+y/x=0, dy/dx=-y/x. We multiply both parts of the equation by dx and divide by xy≠0: dy/y=-dx/x. We integrate:
2) In the obtained general solution of the homogeneous equation, we will consider С not a constant, but a function of x: С=С(x). From here
The resulting expressions are substituted into condition (I):
We integrate both parts of the equation:
here C is already some new constant.
3) In the general solution of the homogeneous equation y \u003d C / x, where we considered C \u003d C (x), that is, y \u003d C (x) / x, instead of C (x) we substitute the found expression x³ + C: y \u003d (x³ +C)/x or y=x²+C/x. We got the same answer as when solving by the Bernoulli method.
Answer: y=x²+C/x.
2) y'+y=cosx.
Here the equation is already written in standard form, no need to convert.
1) We solve a homogeneous linear equation y’+y=0: dy/dx=-y; dy/y=-dx. We integrate:
To get a more convenient notation, we will take the exponent to the power of C as a new C:
This transformation was performed to make it more convenient to find the derivative.
2) In the obtained general solution of a linear homogeneous equation, we consider С not a constant, but a function of x: С=С(x). Under this condition
The resulting expressions y and y' are substituted into the condition:
Multiply both sides of the equation by
We integrate both parts of the equation using the integration-by-parts formula, we get:
Here C is no longer a function, but an ordinary constant.
3) Into the general solution of the homogeneous equation
we substitute the found function С(x):
We got the same answer as when solving by the Bernoulli method.
The method of variation of an arbitrary constant is also applicable to solving .
y’x+y=-xy².
We bring the equation to standard form: y'+y/x=-y² (II).
1) We solve the homogeneous equation y’+y/x=0. dy/dx=-y/x. Multiply both sides of the equation by dx and divide by y: dy/y=-dx/x. Now let's integrate:
We substitute the obtained expressions into condition (II):
Simplifying:
We got an equation with separable variables for C and x:
Here C is already an ordinary constant. In the process of integration, instead of C(x), we simply wrote C, so as not to overload the notation. And at the end we returned to C(x) so as not to confuse C(x) with the new C.
3) We substitute the found function С(x) into the general solution of the homogeneous equation y=C(x)/x:
We got the same answer as when solving by the Bernoulli method.
Examples for self-test:
1. Let's rewrite the equation in standard form: y'-2y=x.
1) We solve the homogeneous equation y'-2y=0. y’=dy/dx, hence dy/dx=2y, multiply both sides of the equation by dx, divide by y and integrate:
From here we find y:
We substitute the expressions for y and y’ into the condition (for brevity, we will feed C instead of C (x) and C’ instead of C "(x)):
To find the integral on the right side, we use the integration-by-parts formula:
Now we substitute u, du and v into the formula:
Here C = const.
3) Now we substitute into the solution of the homogeneous
A method for solving linear inhomogeneous differential equations of higher orders with constant coefficients by the method of variation of the Lagrange constants is considered. The Lagrange method is also applicable to solving any linear inhomogeneous equations if the fundamental system of solutions of the homogeneous equation is known.
ContentSee also:
Lagrange method (variation of constants)
Consider a linear inhomogeneous differential equation with constant coefficients of an arbitrary nth order:
(1)
.
The method of constant variation, which we considered for the first order equation, is also applicable to equations of higher orders.
The solution is carried out in two stages. At the first stage, we discard the right side and solve the homogeneous equation. As a result, we obtain a solution containing n arbitrary constants. In the second step, we vary the constants. That is, we consider that these constants are functions of the independent variable x and find the form of these functions.
Although we are considering equations with constant coefficients here, but the Lagrange method is also applicable to solving any linear inhomogeneous equations. For this, however, the fundamental system of solutions of the homogeneous equation must be known.
Step 1. Solution of the homogeneous equation
As in the case of first-order equations, we first look for the general solution of the homogeneous equation, equating the right inhomogeneous part to zero:
(2)
.
The general solution of such an equation has the form:
(3)
.
Here are arbitrary constants; - n linearly independent solutions of the homogeneous equation (2), which form the fundamental system of solutions of this equation.
Step 2. Variation of Constants - Replacing Constants with Functions
In the second step, we will deal with the variation of the constants. In other words, we will replace the constants with functions of the independent variable x :
.
That is, we are looking for a solution to the original equation (1) in the following form:
(4)
.
If we substitute (4) into (1), we get one differential equation for n functions. In this case, we can connect these functions with additional equations. Then you get n equations, from which you can determine n functions. Additional equations can be written in various ways. But we will do it in such a way that the solution has the simplest form. To do this, when differentiating, you need to equate to zero terms containing derivatives of functions. Let's demonstrate this.
To substitute the proposed solution (4) into the original equation (1), we need to find the derivatives of the first n orders of the function written in the form (4). Differentiate (4) by applying the rules for differentiating the sum and the product:
.
Let's group the members. First, we write out the terms with derivatives of , and then the terms with derivatives of :
.
We impose the first condition on the functions:
(5.1)
.
Then the expression for the first derivative with respect to will have a simpler form:
(6.1)
.
In the same way, we find the second derivative:
.
We impose the second condition on the functions:
(5.2)
.
Then
(6.2)
.
And so on. Under additional conditions, we equate the terms containing the derivatives of the functions to zero.
Thus, if we choose the following additional equations for functions:
(5.k) ,
then the first derivatives with respect to will have the simplest form:
(6.k) .
Here .
We find the nth derivative:
(6.n)
.
We substitute into the original equation (1):
(1)
;
.
We take into account that all functions satisfy equation (2):
.
Then the sum of the terms containing give zero. As a result, we get:
(7)
.
As a result, we have a system linear equations for derivatives:
(5.1)
;
(5.2)
;
(5.3)
;
. . . . . . .
(5.n-1) ;
(7') .
Solving this system, we find expressions for derivatives as functions of x . Integrating, we get:
.
Here, are constants that no longer depend on x. Substituting into (4), we obtain the general solution of the original equation.
Note that we never used the fact that the coefficients a i are constant to determine the values of the derivatives. That's why the Lagrange method is applicable to solve any linear inhomogeneous equations, if the fundamental system of solutions of the homogeneous equation (2) is known.
Examples
Solve equations by the method of variation of constants (Lagrange).
Solution of examples > > >
Solving higher-order equations by the Bernoulli method
Solving Linear Inhomogeneous Higher-Order Differential Equations with Constant Coefficients by Linear Substitution
The method of variation of arbitrary constants is used to solve inhomogeneous differential equations. This lesson designed for those students who are already more or less well versed in the topic. If you are just starting to get acquainted with the remote control, i.e. If you are a teapot, I recommend starting with the first lesson: First order differential equations. Solution examples. And if you are already finishing, please discard the possible preconceived notion that the method is difficult. Because he is simple.
In what cases is the method of variation of arbitrary constants used?
1) The method of variation of an arbitrary constant can be used to solve linear inhomogeneous DE of the 1st order. Since the equation is of the first order, then the constant (constant) is also one.
2) The method of variation of arbitrary constants is used to solve some linear inhomogeneous equations of the second order. Here, two constants (constants) vary.
It is logical to assume that the lesson will consist of two paragraphs .... I wrote this proposal, and for about 10 minutes I was painfully thinking what other smart crap to add for a smooth transition to practical examples. But for some reason, there are no thoughts after the holidays, although it seems that I did not abuse anything. So let's jump right into the first paragraph.
Arbitrary Constant Variation Method
for a linear inhomogeneous first-order equation
Before considering the method of variation of an arbitrary constant, it is desirable to be familiar with the article Linear differential equations of the first order. In that lesson, we practiced first way to solve inhomogeneous DE of the 1st order. This first solution, I remind you, is called replacement method or Bernoulli method(not to be confused with Bernoulli equation!!!)
We will now consider second way to solve– method of variation of an arbitrary constant. I will give only three examples, and I will take them from the above lesson. Why so few? Because in fact the solution in the second way will be very similar to the solution in the first way. In addition, according to my observations, the method of variation of arbitrary constants is used less often than the replacement method.
Example 1
(Diffur from Example No. 2 of the lesson Linear inhomogeneous DE of the 1st order)
Solution: This equation is linear inhomogeneous and has a familiar form:
The first step is to solve a simpler equation:
That is, we stupidly reset the right side - instead we write zero.
The equation I'll call auxiliary equation.
AT this example solve the following auxiliary equation:
Before us separable equation, the solution of which (I hope) is no longer difficult for you:
In this way:
is the general solution of the auxiliary equation .
On the second step replace a constant of some yet unknown function that depends on "x":
Hence the name of the method - we vary the constant . Alternatively, the constant can be some function that we have to find now.
AT initial inhomogeneous equation Let's replace:
Substitute and into the equation :
control moment - the two terms on the left side cancel. If this does not happen, you should look for the error above.
As a result of the replacement, an equation with separable variables is obtained. Separate variables and integrate.
What a blessing, the exponents are shrinking too:
We add a “normal” constant to the found function:
On the final stage remember our replacement:
Function just found!
So the general solution is:
Answer: common decision:
If you print out the two solutions, you will easily notice that in both cases we found the same integrals. The only difference is in the solution algorithm.
Now something more complicated, I will also comment on the second example:
Example 2
Find the general solution of the differential equation
(Diffur from Example No. 8 of lesson Linear inhomogeneous DE of the 1st order)
Solution: We bring the equation to the form :
Set the right side to zero and solve the auxiliary equation:
General solution of the auxiliary equation:
In the inhomogeneous equation, we will make the substitution:
According to the product differentiation rule:
Substitute and into the original inhomogeneous equation :
The two terms on the left side cancel out, which means we are on the right track:
We integrate by parts. A tasty letter from the formula for integration by parts is already involved in the solution, so we use, for example, the letters "a" and "be":
Now let's look at the replacement:
Answer: common decision:
And one example for self solution:
Example 3
Find a particular solution of the differential equation corresponding to the given initial condition.
,
(Diffur from Lesson 4 Example Linear inhomogeneous DE of the 1st order)
Solution:
This DE is linear inhomogeneous. We use the method of variation of arbitrary constants. Let's solve the auxiliary equation:
We separate the variables and integrate:
Common decision:
In the inhomogeneous equation, we will make the substitution:
Let's do the substitution:
So the general solution is:
Find a particular solution corresponding to the given initial condition:
Answer: private solution:
The solution at the end of the lesson can serve as an approximate model for finishing the assignment.
Method of Variation of Arbitrary Constants
for a linear inhomogeneous second order equation
with constant coefficients
One often heard the opinion that the method of variation of arbitrary constants for a second-order equation is not an easy thing. But I guess the following: most likely, the method seems difficult to many, since it is not so common. But in reality, there are no particular difficulties - the course of the decision is clear, transparent, and understandable. And beautiful.
To master the method, it is desirable to be able to solve inhomogeneous equations of the second order by selecting a particular solution according to the form of the right side. This method discussed in detail in the article. Inhomogeneous DE of the 2nd order. We recall that a second-order linear inhomogeneous equation with constant coefficients has the form:
The selection method, which was considered in the above lesson, only works in a limited number of cases, when polynomials, exponents, sines, cosines are on the right side. But what to do when on the right, for example, a fraction, logarithm, tangent? In such a situation, the method of variation of constants comes to the rescue.
Example 4
Find the general solution of a second-order differential equation
Solution: There is a fraction on the right side of this equation, so we can immediately say that the method of selecting a particular solution does not work. We use the method of variation of arbitrary constants.
Nothing portends a thunderstorm, the beginning of the solution is quite ordinary:
Let's find common decision relevant homogeneous equations:
We compose and solve the characteristic equation:
– conjugate complex roots are obtained, so the general solution is:
Pay attention to the record of the general solution - if there are brackets, then open them.
Now we do almost the same trick as for the first order equation: we vary the constants , replacing them with unknown functions . That is, general solution of the inhomogeneous We will look for equations in the form:
Where - yet unknown functions.
It looks like a garbage dump, but now we'll sort everything.
Derivatives of functions act as unknowns. Our goal is to find derivatives, and the found derivatives must satisfy both the first and second equations of the system.
Where do "games" come from? The stork brings them. We look at the previously obtained general solution and write:
Let's find derivatives:
Dealt with the left side. What's on the right?
is the right side of the original equation, in this case:
The coefficient is the coefficient at the second derivative:
In practice, almost always, and our example is no exception.
Everything cleared up, now you can create a system:
The system is usually solved according to Cramer's formulas using the standard algorithm. The only difference is that instead of numbers we have functions.
Find the main determinant of the system:
If you forgot how the “two by two” determinant is revealed, refer to the lesson How to calculate the determinant? The link leads to the board of shame =)
So: , so the system has a unique solution.
We find the derivative:
But that's not all, so far we've only found the derivative.
The function itself is restored by integration:
Let's look at the second function:
Here we add a "normal" constant
At the final stage of the solution, we recall in what form we were looking for the general solution of the inhomogeneous equation? In such:
The features you need have just been found!
It remains to perform the substitution and write down the answer:
Answer: common decision:
In principle, the answer could open the brackets.
A full check of the answer is performed according to the standard scheme, which was considered in the lesson. Inhomogeneous DE of the 2nd order. But the verification will not be easy, since we have to find rather heavy derivatives and carry out a cumbersome substitution. This is a nasty feature when you're solving diffs like this.
Example 5
Solve the differential equation by the method of variation of arbitrary constants
This is a do-it-yourself example. In fact, the right side is also a fraction. We remember trigonometric formula, by the way, it will need to be applied in the course of the solution.
The method of variation of arbitrary constants is the most universal method. They can solve any equation that can be solved the method of selecting a particular solution according to the form of the right side. The question arises, why not use the method of variation of arbitrary constants there as well? The answer is obvious: the selection of a particular solution, which was considered in the lesson Inhomogeneous equations of the second order, significantly speeds up the solution and reduces the notation - no messing around with determinants and integrals.
Consider two examples with Cauchy problem.
Example 6
Find a particular solution of the differential equation corresponding to given initial conditions
,
Solution: Again, the fraction and the exponent in an interesting place.
We use the method of variation of arbitrary constants.
Let's find common decision relevant homogeneous equations:
– different real roots are obtained, so the general solution is:
The general solution of the inhomogeneous we are looking for equations in the form: , where - yet unknown functions.
Let's create a system:
In this case:
,
Finding derivatives:
,
In this way:
We solve the system using Cramer's formulas:
, so the system has a unique solution.
We restore the function by integration:
Used here method of bringing a function under a differential sign.
We restore the second function by integration:
Such an integral is solved variable substitution method:
From the replacement itself, we express:
In this way:
This integral can be found full square selection method, but in examples with diffurs, I prefer to expand the fraction method of uncertain coefficients:
Both functions found:
As a result, the general solution of the inhomogeneous equation is:
Find a particular solution that satisfies the initial conditions .
Technically, the search for a solution is carried out in a standard way, which was discussed in the article. Inhomogeneous Second Order Differential Equations.
Hold on, now we will find the derivative of the found general solution:
Here is such a disgrace. It is not necessary to simplify it, it is easier to immediately compose a system of equations. According to the initial conditions :
Substitute the found values of the constants into a general solution:
In the answer, the logarithms can be packed a little.
Answer: private solution:
As you can see, difficulties can arise in integrals and derivatives, but not in the algorithm of the method of variation of arbitrary constants. It was not I who intimidated you, this is all a collection of Kuznetsov!
To relax, a final, simpler, self-solving example:
Example 7
Solve the Cauchy problem
,
The example is simple, but creative, when you make a system, look at it carefully before deciding ;-),
As a result, the general solution is:
Find a particular solution corresponding to the initial conditions .
We substitute the found values of the constants into the general solution:
Answer: private solution:
Method of Variation of Arbitrary Constants
Method of variation of arbitrary constants for constructing a solution to a linear inhomogeneous differential equation
a n (t)z (n) (t) + a n − 1 (t)z (n − 1) (t) + ... + a 1 (t)z"(t) + a 0 (t)z(t) = f(t)
consists in changing arbitrary constants c k in the general decision
z(t) = c 1 z 1 (t) + c 2 z 2 (t) + ... + c n z n (t)
corresponding homogeneous equation
a n (t)z (n) (t) + a n − 1 (t)z (n − 1) (t) + ... + a 1 (t)z"(t) + a 0 (t)z(t) = 0
to helper functions c k (t) , whose derivatives satisfy the linear algebraic system
The determinant of system (1) is the Wronskian of functions z 1 ,z 2 ,...,z n , which ensures its unique solvability with respect to .
If are antiderivatives for taken at fixed values of the constants of integration, then the function
is a solution to the original linear inhomogeneous differential equation. Integration of an inhomogeneous equation in the presence of a general solution of the corresponding homogeneous equation is thus reduced to quadratures.
Method of variation of arbitrary constants for constructing solutions to a system of linear differential equations in vector normal form
consists in constructing a particular solution (1) in the form
where Z(t) is the basis of solutions of the corresponding homogeneous equation, written as a matrix, and the vector function , which replaced the vector of arbitrary constants, is defined by the relation . The desired particular solution (with zero initial values at t = t 0 has the form
For a system with constant coefficients, the last expression is simplified:
Matrix Z(t)Z− 1 (τ) called Cauchy matrix operator L = A(t) .