Solving differential equations :

dsolve

- linear differential equations with constant coefficients,
- first order linear differential equations,
- first order differential equations without
*y*, - first order differential equations without
*x*, - first order differential equations with separated variables,
- first order homogeneous differential equations (
*y'*=*F*(*y*/*x*)), - first order differential equations with integrating factor,
- first order Bernoulli differential equations (
*a*(*x*)*y'*+*b*(*x*)*y*=*c*(*x*)*y*^{n}), - first order Clairaut differential equations (
*y*=*x***y'*+*f*(*y'*)).

- if the independant variable is the current variable (here supposed
to be
*x*),- the differential equation (or the list of the differential equation and of the initial conditions)
- the unknown (usually
`y`).

*y*is denoted by*y*, it's first derivative*y*is denoted by , and it's second derivative*y'*' is written .

For example`desolve(y''+2*y'+y,y)`or`desolve([y''+2*y'+y,y(0)=1,y'(0)=0],y)`. - if the independant variable is not the current variable,
for example
*t*instead of*x*,- the differential equation (or the list of the differential equation and of the initial conditions),
- the variable, e.g.
`t` - the unknown as a variable
`y`or as a function`y(t)`.

*y*is denoted by*y*(*t*), it's derivative*y*is denoted by`diff(y(t),t)`, and it's second derivative*y'*' is denoted by`diff(y(t),t$2)`.

For example :`desolve(diff(y(t),t$2)+2*diff(y(t),t)+y(t),y(t))`; or`desolve(diff(y(t),t$2)+2*diff(y(t),t)+y(t),t,y)`; anddesolve([diff(y(t),t$2)+2*diff(y(t),t)+y(t), y(0)=1,y'(0)=0],y(t)); or desolve([diff(y(t),t$2)+2*diff(y(t),t)+y(t), y(0)=1,y'(0)=0],t,y);

- Examples of second linear differential equations with constant
coefficients.
- Solve :
*y''*+*y*= cos(*x*)`y''`):`desolve(y''+y=cos(x),y)``desolve((diff(diff(y))+y)=(cos(x)),y)``c_0*cos(x)+(x+2*c_1)*sin(x)/2``c_0, c_1`are the constants of integration :`y(0)=c_0`and`y'(0)=c_1`.

If the variable is not`x`but`t`, input :`desolve(derive(derive(y(t),t),t)+y(t)=cos(t),t,y)``c_0*cos(t)+(t+2*c_1)/2*sin(t)``c_0, c_1`are the constants of integration :`y(0)=c_0`and`y'(0)=c_1`. - Solve :
*y''*+*y*= cos(*x*),*y*(0) = 1`desolve([y''+y=cos(x),y(0)=1],y)``[cos(x)+(x+2*c_1)/2*sin(x)]``c_1`). - Solve :
*y''*+*y*= cos(*x*) (*y*(0))^{2}= 1`desolve([y''+y=cos(x),y(0)``^`

2=1],y)`[-cos(x)+(x+2*c_1)/2*sin(x),cos(x)+(x+2*c_1)/2*sin(x)]``c_1`(*y'*(0) =*c*_{1}) and corresponding to*y*(0) = 1 and to*y*(0) = - 1. - Solve :
*y''*+*y*= cos(*x*), (*y*(0))^{2}= 1*y'*(0) = 1`desolve([y''+y=cos(x),y(0)``^`

2=1,y'(0)=1],y)`[-cos(x)+(x+2)/2*sin(x),cos(x)+(x+2)/2*sin(x)]` - Solve :
*y''*+ 2*y'*+*y*= 0`desolve(y''+2*y'+y=0,y)``(x*c_0+x*c_1+c_0)*exp(-x)``c_0, c_1`(`y(0)=c_0`and`y'(0)=c_1`). - Solve :
*y''*- 6*y'*+ 9*y*=*xe*^{3x}`desolve(y''-6*y'+9*y=(x*exp(3*x),y)``(x``^`

3+(-(18*x))*c_0+6*x*c_1+6*c_0)*1/6*exp(3*x)`c_0, c_1`(`y(0)=c_0`and`y'(0)=c_1`).

- Solve :
- Examples of first order linear differential equations.
- Solve :
*xy'*+*y*- 3*x*^{2}= 0`desolve(x*y'+y-3*x``^`

2,y)`(3*1/3*x``^`

3+c_0)/x - Solve :
*y'*+*x***y*= 0,*y*(0) = 1`desolve([y'+x*y=0, y(0)=1]),y)``desolve((y'+x*y=0) && (y(0)=1),y)``[1/(exp(1/2*x``^`

2))] - Solve :
*x*(*x*^{2}- 1)*y'*+ 2*y*= 0`desolve(x*(x``^`

2-1)*y'+2*y=0,y)`(c_0)/((x``^`

2-1)/(x`^`

2)) - Solve :
*x*(*x*^{2}-1)*y'*+ 2*y*=*x*^{2}`desolve(x*(x``^`

2-1)*y'+2*y=x`^`

2,y)`(ln(x)+c_0)/((x``^`

2-1)/(x`^`

2)) - If the variable is
*t*instead of*x*, for example :*t*(*t*^{2}-1)*y'*(*t*) + 2*y*(*t*) =*t*^{2}`desolve(t*(t``^`

2-1)*diff(y(t),t)+2*y(t)=(t`^`

2),y(t))`(ln(t)+c_0)/((t``^`

2-1)/(t`^`

2)) - Solve :
*x*(*x*^{2}-1)*y'*+ 2*y*=*x*^{2},*y*(2) = 0`desolve([x*(x``^`

2-1)*y'+2*y=x`^`

2,y(0)=1],y)`[(ln(x)-ln(2))*1/(x``^`

2-1)*x`^`

2] - Solve :
*y'*-*x*-*y*=`desolve(y'*sqrt(1+x``^`

2)-x-y-sqrt(1+x`^`

2),y)`(-c_0+ln(sqrt(x``^`

2+1)-x))/(x-sqrt(x`^`

2+1))

- Solve :
- Examples of first differential equations with separated variables.
- Solve :
*y'*= 2`desolve(y'=2*sqrt(y),y)``[x``^`

2+-2*x*c_0+c_0`^`

2] - Solve :
*xy'*ln(*x*) -*y*(3 ln(*x*) + 1) = 0`desolve(x*y'*ln(x)-(3*ln(x)+1)*y,y)``c_0*x``^`

3*ln(x)

- Solve :
- Examples of Bernoulli differential equations
*a*(*x*)*y'*+*b*(*x*)*y*=*c*(*x*)*y*^{n}where*n*is a real constant.

The method used is to divide the equation by*y*^{n}, so that it becomes a first order linear differential equation in*u*= 1/*y*^{n-1}.- Solve :
*xy'*+ 2*y*+*xy*^{2}= 0`desolve(x*y'+2*y+x*y``^`

2,y)`[1/(exp(2*ln(x))*(-1/x+c_0))]` - Solve :
*xy'*- 2*y*=*xy*^{3}`desolve(x*y'-2*y-x*y``^`

3,y)`[((-2*1/5*x``^`

5+c_0)*exp(-(4*log(x))))`^`

(1/-2),`-((-2*1/5*x``^`

5+c_0)*exp(-(4*log(x))))`^`

(1/-2)] - Solve :
*x*^{2}*y'*- 2*y*=*xe*^{(}4/*x*)*y*^{3}`desolve(x*y'-2*y-x*exp(4/x)*y``^`

3,y)`[((-2*ln(x)+c_0)*exp(-(4*(-(1/x)))))``^`

(1/-2),`-(((-2*ln(x)+c_0)*exp(-(4*(-(1/x)))))``^`

(1/-2))]

- Solve :
- Examples of first order homogeneous differential equations (
*y'*=*F*(*y*/*x*), the method of integration is to search*t*=*y*/*x*instead of*y*).- Solve :
(3Input :
*x*^{3}*y'*=*y*(3*x*^{2}-*y*^{2})`desolve(3*x``^`

3*diff(y)=((3*x`^`

2-y`^`

2)*y),y)`[0,pnt[c_0*exp((3*1/2)/(` t```^`

2)),` t`*c_0*exp((3*1/2)/(` t``^`

2))]]*y*= 0 and the familiy of curves of parametric equation*x*=*c*_{0}exp(3/(2*t*^{2})),*y*=*t***c*_{0}exp(3/(2*t*^{2})) (the parameter is denoted by`` t``in the answer). - Solve :
*xy'*=*y*+`desolve(x*y'=y+sqrt(x``^`

2+y`^`

2),y)`[(-i)*x,(i)*x,pnt[c_0/(sqrt(` t```^`

2+1)-` t`),(` t`*c_0)/(sqrt(` t``^`

2+1)-` t`)]]*y*=*ix*,*y*= -*ix**x*=*c*_{0}/( -*t*),*y*=*t***c*_{0}/( -*t*)`` t``in the answer).

- Solve :
- Examples of first order differential equations with an
integrating factor. By multiplying the equation by a function of
*x*,*y*, it becomes a closed differential form.- Solve :
*yy'*+*x*`desolve(y*y'+x,y)``[sqrt(-2*c_0-x``^`

2),-(sqrt(-2*c_0-x`^`

2))]*xdx*+*ydy*is closed, the integrating factor was 1. - Solve :
2Input :
*xyy'*+*x*^{2}-*y*^{2}+*a*^{2}= 0`desolve(2*x*y*y'+x``^`

2-y`^`

2+a`^`

2,y)`[sqrt(a``^`

2-x`^`

2-c_1*x),-(sqrt(a`^`

2-x`^`

2-c_1*x))]*x*^{2}.

- Solve :
- Example of first order differential equations without
*x*.

Solve :(This kind of equations can not be solved directly by*y*+*y'*)^{4}+*y'*+ 3*y*= 0`Xcas`, we explain how to solve them with it's help. The idea is to find a parametric representation of*F*(*u*,*v*) = 0 where the equation is*F*(*y*,*y'*) = 0, Let*u*=*f*(*t*),*v*=*g*(*t*) be such a parametrization of*F*= 0, then*y*=*f*(*t*) and*dy*/*dx*=*y'*=*g*(*t*). Hence*dy*/*dt*=*f'*(*t*) =*y'***dx*/*dt*=*g*(*t*)**dx*/*dt**x*(*t*),*y*(*t*) =*f*(*t*), where*x*(*t*) is solution of the differential equation*g*(*t*)*dx*=*f'*(*t*)*dt*.

Back to the example, we put*y*+*y'*=*t*, hence:*y*= -*t*- 8**t*^{4},*y'*=*dy*/*dx*= 3**t*+ 8**t*^{4}*dy*/*dt*= - 1 - 32**t*^{3}(3*Input :*t*+ 8**t*^{4})**dx*= (- 1 - 32**t*^{3})*dt*`desolve((3*t+8*t``^`

4)*diff(x(t),t)=(-1-32*t`^`

3),x(t))`-11*1/9*ln(8*t``^`

3+3)+1/-9*ln(t`^`

3)+c_0*x*(*t*) = - 11*1/9*ln(8**t*^{3}+3) + 1/ -9*ln(*t*^{3}) +*c*_{0},*y*(*t*) = -*t*- 8**t*^{4} - Examples of first order
Clairaut differential equations (
*y*=*x***y'*+*f*(*y'*)).

The solutions are the lines*D*_{m}of equation*y*=*mx*+*f*(*m*) where*m*is a real constant.- Solve :
*xy'*+*y'*^{3}-*y*) = 0`desolve(x*y'+y'``^`

3-y),y)`c_0*x+c_0``^`

3 - Solve :
*y*-*xy'*= = 0`desolve((y-x*y'-sqrt(a``^`

2+b`^`

2*y'`^`

2),y)`c_0*x+sqrt(a``^`

2+b`^`

2*c_0`^`

2)

- Solve :