You are on page 1of 6

(usando MAPLE VI, gpo.

22-m curso 04/05)

RESOLUCIN DE ECUACIONES DIFERENCIALES LINEALES

EJEMPLO1.cargamos la librera para el tratamiento de ecuaciones diferenciales


> with(DEtools):
escribimos la ecuacin concreta como una expresin, dndole el nombre que queramos
> ode1 := diff(y(x),x$3)-diff(y(x),x$2)+diff(y(x),x$1)-y(x)=x^2+

x;

d
d
d

ode1 := 3 y( x ) 2 y( x ) + y( x ) y( x ) = x2 + x

dx
dx
dx
con esta orden me la clasifica qu listo!
> odeadvisor(ode1,y(x));
3

[ [ _3rd_order, _linear, _nonhomogeneous ] ]


Tambin es capaz de resolverla, en este caso con sus tres ctes. de integracin correspondientes
> dsolve(ode1, y(x));
2

y( x ) = 1 3 x x + _C1 cos( x ) + _C2 sin( x ) + _C3 e


EJEMPLO 2.
> ode2 :=

x^2*diff(y(x),x$2)+2*x*diff(y(x),x$1)-6*y(x)=0;
d2

ode2 := x2 2 y( x ) + 2 x y( x ) 6 y( x ) = 0
d
x

dx

> odeadvisor(ode2,y(x));
[ [ _Emden, _Fowler ], [ _2nd_order, _linear, _with_symmetry_[0,F(x)] ] ]
> dsolve(ode2, y(x));
1 _C1
2
y( x ) =
+ _C2 x
5
5 x

EJEMPLO 3.
> ode3 :=

diff(y(x),x$2)+y(x)-csc(x)=0;
d2

ode3 := 2 y( x ) + y( x ) csc( x ) = 0
dx

> odeadvisor(ode3,y(x));
[ [ _2nd_order, _linear, _nonhomogeneous ] ]
> dsolve(ode3, y(x));
y( x ) = x cos( x ) + ln( sin( x ) ) sin( x ) + _C1 cos( x ) + _C2 sin( x )
PROGRAMA que hace todo lo anterior de una sola vez
>
>
>
>
>
>

resuelve:=proc(ed)
local tipo,solu,ecu;
ecu:=ed;
tipo:=odeadvisor(ecu,y(x));
solu:=dsolve(ecu, y(x));
RETURN(cat(`la ecuacin `,ecu,`es del tipo: `,tipo),cat(`y su solucin general
es: `,solu));
> end:
> resuelve(diff(y(x),x$3)-diff(y(x),x$2)+diff(y(x),x$1)-y(x)=x^2+ x);
d3
d

d2

la ecuacin || 3 y( x ) 2 y( x ) + y( x ) y( x ) = x2 + x ||es del tipo: ||

dx
dx

dx
[ [ _3rd_order, _linear, _nonhomogeneous ] ],
y su solucin general es: ||( y( x ) = 1 3 x x2 + _C1 cos( x ) + _C2 sin( x ) + _C3 ex )
iV)
> resuelve((x-3)^2*diff(y(x),x$2)+3*y(x)=2);
d2

la ecuacin || ( x 3 )2 2 y( x ) + 3 y( x ) = 2 ||es del tipo: ||[ [ _2nd_order, _with_linear_symmetries ] ],


dx

2
1

y su solucin general es: || y( x ) = + _C1 x 3 cos


11 ln( x 3 ) + _C2 x 3 sin
11 ln( x 3 )
3
2

v)
> resuelve(diff(y(x),x$2)+10*diff(y(x),x)+25*y(x)=14*exp(-5*x)+3*x);
d2

( 5 x )
la ecuacin || 2 y( x ) + 10 y( x ) + 25 y( x ) = 14 e
+ 3 x ||es del tipo: ||
dx

dx

_2nd_order
_linear
_nonhomogeneous
[[
,
,
] ],
1

(5 x)
(5 x)
( 5 x )
( 5 x )
( 5 x )
2

y su solucin general es: || y( x ) =


( 875 x + 15 x e
+ _C1 e
+ _C2 x e
6e )e
125

vi)
> resuelve(x^2*diff(y(x),x$3)+2*x*diff(y(x),x$2)-4*diff(y(x),x$1)+4*y(x)/x=2*x);

d2

d3

y( x )
d

la ecuacin || x2 3 y( x ) + 2 x 2 y( x ) 4 y( x ) + 4
= 2 x ||es del tipo: ||[ [ _3rd_order, _reducible ] ],
x
d
x

dx

dx

_C3
5 2 1

y su solucin general es: || y( x ) = x + ln( x ) x2 + _C1 x + _C2 x2 + 2


8
2
x

vii)para esta ecuacin resulta ms prctico aplicar el principio de superposicin


> ecu:=diff(y(x),x$2)+diff(y(x),x$1)+y(x)=exp(2*x)-sin(x);
d2
d

(2 x)
ecu := 2 y( x ) + y( x ) + y( x ) = e
sin( x )
d
x

dx

> so1:=dsolve(diff(y(x),x$2)+diff(y(x),x$1)+y(x)=exp(2*x),'output=basis' );
( 1 / 2 x)
1
1 (2 x)
( 1 / 2 x) 1
so1 := e
3 x , e
3 x , e
sin
cos
2

2
7

> so2:=dsolve(diff(y(x),x$2)+diff(y(x),x$1)+y(x)=-sin(x),'output=basis' );
( 1 / 2 x) 1
so2 := e
sin
2

( 1 / 2 x)
1
cos
3 x , e

3 x , cos( x )

> cat(`la solucin general de `,ecu,`es:


`);print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);
d2

(2 x)
la solucin general de || 2 y( x ) + y( x ) + y( x ) = e
sin( x ) ||es:

dx

dx
1 (2 x)
1

( 1 / 2 x)
( 1 / 2 x)
y= e
sin
cos
3 x + c2 e
3 x
+ cos( x ) + c1 e
7
2

viii)

a) caso 1. b=k.
> ecu:=diff(y(x),x$2)+k^2*y(x)=sin(k*x):
> so1:=dsolve(ecu,'output=basis' );
1 cos( k x ) x

so1 := [ sin( k x ), cos( k x ) ],


k
2

> cat(`la solucin general de `,ecu,`es:


`);print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);
d2

la solucin general de || 2 y( x ) + k2 y( x ) = sin( k x ) ||es:


dx

1 cos( k x ) x
y=
+ cos( x ) + c1 sin( k x ) + c2 cos( k x )
k
2

b)caso 2. valores distintos.


> assume(b<>k):ecu:=diff(y(x),x$2)+k^2*y(x)=sin(b*x):
> so1:=dsolve(ecu,'output=basis' );
sin( b~ x )

so1 := [ cos( k~ x ), sin( k~ x ) ],


2
2
k~ + b~

> cat(`la solucin general de `,ecu,`es:


`);print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);

d2

la solucin general de || 2 y( x ) + k~2 y( x ) = sin( b~ x ) ||es:


dx

sin( b~ x )
y=
+ cos( x ) + c1 cos( k~ x ) + c2 sin( k~ x )
2
2
k~ + b~
ix)
> ecu:=diff(y(x),x$2)+y(x)=sin(x):so1:=dsolve(ecu,'output=basis' );
1
1

so1 := [ cos( x ), sin( x ) ], sin( x ) cos( x ) x


2
2

> ecu2:=diff(y(x),x$2)+y(x)=(x/((x+1)^2)):so2:=dsolve(ecu2,'output=basis' );
so2 := [ [ cos( x ), sin( x ) ], Si( x + 1 ) cos( x + 1 ) + Ci( x + 1 ) cos( x + 1 ) + Si( x + 1 ) sin( x + 1 ) + Ci( x + 1 ) sin( x + 1 ) ]
> ecu:=op(1,ecu)=op(2,ecu)+op(2,ecu2);
d2

x
ecu := 2 y( x ) + y( x ) = sin( x ) +
( x + 1 )2
dx

> print("la solucin general de", ecu,"es


");print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);
d2

x
"la solucin general de", 2 y( x ) + y( x ) = sin( x ) +
, "es "
2
(x + 1)
dx

y=

1
2

sin( x )

cos( x ) x Si( x + 1 ) cos( x + 1 ) + Ci( x + 1 ) cos( x + 1 ) + Si ( x + 1 ) sin( x + 1 ) + Ci( x + 1 ) sin( x + 1 )


2
+ c1 cos( x ) + c2 sin( x )
x

sin( t )
dt
> Si( x ) :=

t
0
x)
> resuelve(diff(y(x),x$4)-2*diff(y(x),x$3)+2*diff(y(x),x$2)-2*diff(y(x),x$1)+y(x)=e
xp(x)+1);
d3

d2

d4

la ecuacin || 4 y( x ) 2 3 y( x ) + 2 2 y( x ) 2 y( x ) + y( x ) = ex + 1 ||es del tipo: ||


dx

dx

dx

dx

[ [ _high_order, _linear, _nonhomogeneous ] ],


1
1
1

y su solucin general es: || y( x ) = ex + x2 ex + 1 x ex + _C1 cos( x ) + _C2 sin( x ) + _C3 ex + _C4 x ex


4
4
2

xi)
> resuelve(x^2*diff(y(x),x$2)-x*diff(y(x),x$1)-3*y(x)=-16*(log(x))/x);

d2
ln( x )
d

la ecuacin || x2 2 y( x ) x y( x ) 3 y( x ) = 16
||es del tipo: ||
x
dx

dx
[ [ _2nd_order, _exact, _linear, _nonhomogeneous ] ],
2

1 8 ln( x ) + 4 ln( x ) + 1 _C1


3
y su solucin general es: || y( x ) =
+
+ _C2 x
x
x
4

xii)
> a:='a':b:='b':n:='n':assume(n>0):solve(k^4+2*(n^2)*(k^2)+n^4=0,k);
I n~, I n~, I n~, I n~
> ecu:=diff(y(x),x$4)+2*n^2*diff(y(x),x$2)+n^4*y(x)=a*sin(n*x+b):so1:=dsolve(ecu,'o
utput=basis' );

so1 := [ cos( n~ x ), sin( n~ x ), sin( n~ x ) x, cos( n~ x ) x ],

2 2
1 8 a n~ x sin( n~ x + b ) 16 a n~ x cos( n~ x + b ) + 13 a sin( n~ x + b ) + 3 a sin( b + n~ x )

64
n~4

> resuelve(diff(y(x),x$4)+2*n^2*diff(y(x),x$2)+n^4*y(x)=a*sin(n*x+b));

d2
d4

la ecuacin || 4 y( x ) + 2 n~2 2 y( x ) + n~4 y( x ) = a sin( n~ x + b ) ||es del tipo: ||


dx
dx

a ( 4 sin( n~ x ) cos( b ) n~2 x2


[ [ _high_order, _linear, _nonhomogeneous ] ], y su solucin general es: || y( x ) =
32

2 2
+ 4 cos( n~ x ) sin( b ) n~ x + 8 cos( n~ x ) cos( b ) n~ x 8 sin( n~ x ) sin( b ) n~ x 5 cos( n~ x ) sin( b )

8 cos( b ) sin( n~ x ) )

n~4 + _C1 cos( n~ x ) + _C2 sin( n~ x ) + _C3 sin( n~ x ) x + _C4 cos( n~ x ) x

ejercicio 2.

a)
> ecuacion:=diff(y(x),x$2)-x*f(x)*diff(y(x),x)+f(x)*y(x);
d2

ecuacion := 2 y( x ) x f( x ) y( x ) + f( x ) y( x )
dx

dx

comprobamos que y=x es solucin particular


> g:=x->x:diff(g(x),x$2)-x*f*diff(g(x),x)+f*g(x)=0;
0=0
> sol:=x:
> sfun:=reduceOrder( ecuacion, y(x), sol,basis);

> cat(`la sol. gral. ser:

( x f( x ) dx )

d
sfun := x, x
x
2

c`,sfun[1],` + k `,sfun[2]);

( x f( x ) dx )

d
la sol. gral. ser: cx + k || x
x
2

b)
> ecuacion:=diff(y(x),x$2)-f(x)*diff(y(x),x)+(f(x)-1)*y(x);
d2

ecuacion := 2 y( x ) f( x ) y( x ) + ( f( x ) 1 ) y( x )
d
x

d
x

comprobamos que y=exp(x) es solucin particular


> g:=x->exp(x):simplify(diff(g(x),x$2)-f(x)*diff(g(x),x)+(f(x)-1)*g(x));
0
> sol:=exp(x):
> sfun:=reduceOrder( ecuacion, y(x), sol,basis);

> cat(`la sol. gral. ser:

( f( x ) dx 2 x )

x x

dx
sfun := e , e e

c`,sfun[1],` + k `,sfun[2]);

( f( x ) dx 2 x )

dx
la sol. gral. ser: c ||( e )|| + k || ex e

c)
> ecuacion:=x*diff(y(x),x$2)+2*diff(y(x),x)+x*y(x);
d2

ecuacion := x 2 y( x ) + 2 y( x ) + x y( x )
dx

dx

comprobamos que y=Senx/x es solucin particular


> g:=x->sin(x)/x:simplify(x*diff(g(x),x$2)+2*diff(g(x),x)+x*g(x));
0
> sol:=sin(x)/x:
> sfun:=reduceOrder( ecuacion, y(x), sol,basis);

> cat(`la sol. gral. ser:

cos( x )
sin( x )

sfun :=
,
x
x
c`,sfun[1],` + k `,sfun[2]);

sin( x )
|| + k
la sol. gral. ser: c ||
x

cos( x )

||
x

ejercicio 3.

a)
> ecuacion:=x*diff(y(x),x$2)+(2-3*x)*diff(y(x),x)-3*y(x)-20*x^3+15*x^4;
d2

ecuacion := x 2 y( x ) + ( 2 3 x ) y( x ) 3 y( x ) 20 x3 + 15 x4
dx

dx

obligamos a que y=x^m sea solucin particular


> assume(m,integer):g:=x->x^m:simplify(x*diff(g(x),x$2)+(2-3*x)*diff(g(x),x)-3*g(
x)-20*x^3+15*x^4);
x

( m~ 1 )

m~2 + x

( m~ 1 )

m~ 3 xm~ m~ 3 xm~ 20 x3 + 15 x4

deducimos que m = 4

b)
> solhom:=x^4-((x^5-7)/x):
> sfun:=reduceOrder( x*diff(y(x),x$2)+(2-3*x)*diff(y(x),x)-3*y(x), y(x),
solhom,basis);

x5 7 1 4 x5 7 ( 3 x )
sfun := x4
,
x
e
x
x
147

> cat(`la sol. gral. ser: `,x^4,`+c`,sfun[1],` + k `,sfun[2]);

x5 7
la sol. gral. ser: ||( x4 )||+c|| x4
|| + k
x

1 4 x5 7 ( 3 x )
x
e
||
x
147

ejercicio 4.
> a:='a':b:='b':c:='c':ecuacion:=(x^2+1)*diff(y(x),x$2)-2*x*diff(y(x),x)-y(x)*(a*x^
2+b*x+c);
d2

ecuacion := ( x2 + 1 ) 2 y( x ) 2 x y( x ) y( x ) ( a x2 + b x + c )
dx

dx

obligamos a que y=exp(xm) sea solucin particular


> assume(m,integer):m:='m':g:=x->exp(x*m):expre:=simplify((x^2+1)*diff(g(x),x$2)-2*
x*diff(g(x),x)-g(x)*(a*x^2+b*x+c));
(x m)

x2 + m2 e
expre := m2 e
> expre:=simplify(expre/exp(m*x));

(x m)

2xme

(x m )

(x m )

a x2 e

(x m)

bxe

(x m)

expre := m2 x2 + m2 2 x m a x2 b x c
> cofic:={coeffs(expre,x)};
cofic := { m2 a, b 2 m, m2 c }
> solve(cofic,{a,b,c}); obtenemos que a, b y c han de valer
2

{ a = m , c = m , b = 2 m }
la ecuacin resultante es
> ecuacion2:=(x^2+1)*diff(y(x),x$2)-2*x*diff(y(x),x)-y(x)*(m^2*x^2-2*m*x+m^2);
d2

ecuacion2 := ( x2 + 1 ) 2 y( x ) 2 x y( x ) y( x ) ( m2 x2 2 x m + m2 )
d
x

dx

> solhom:=exp(m*x):
> sfun:=reduceOrder( ecuacion2, y(x), solhom,basis);
( 2 x m ) 2 2
( 2 x m )
( 2 x m )

x m +4xme
+2e
(x m) 1 4 e
( 2 x m )

e
+e

2
(x m) 1
m
4

sfun := e
,

m
2

> cat(`la sol. gral. ser: `,`c`,sfun[1],` + k `,simplify(sfun[2]));

la sol. gral. ser: c ||( e

(x m )

1 e( x m ) ( 2 m2 x2 + 2 x m + 1 + 2 m2 )

)|| + k ||

m3

ejercicio 5.
> ecuacionh:=x^2*diff(y(x),x$2)-x*(2*x+3)*diff(y(x),x)+y(x)*(x^2+3*x+3);
d2

ecuacionh := x2 2 y( x ) x ( 2 x + 3 ) y( x ) + y( x ) ( x2 + 3 x + 3 )
dx

dx

> solhom:=x*exp(x):sfun:=reduceOrder( ecuacionh, y(x), solhom,basis);


1

sfun := x ex, x3 ex
2

> cat(`la sol. gral.de la homognea ser: `,`c`,sfun[1],` + k


`,simplify(sfun[2]));
1

la sol. gral.de la homognea ser: c ||( x ex )|| + k || x3 ex


2

> ecuacionc:=ecuacionh-(6-x^2)*exp(x);
d2

ecuacionc := x2 2 y( x ) x ( 2 x + 3 ) y( x ) + y( x ) ( x2 + 3 x + 3 ) ( 6 x2 ) ex
dx

dx

> so1:=dsolve(ecuacionc,'output=basis' );
so1 := [ [ x ex, x3 ex ], ex x2 + 2 ex ]
> print("la solucin general de", ecuacionc,"es
");print(y=so1[2]+c1*so1[1][1]+c2*so1[1][2]);
d2

"la solucin general de", x2 2 y( x ) x ( 2 x + 3 ) y( x ) + y( x ) ( x2 + 3 x + 3 ) ( 6 x2 ) ex, "es "


dx

dx

y = ex x2 + 2 ex + c1 x ex + c2 x3 ex
Ejercicio 7.
> ecuacionh:=x^2*diff(y(x),x$2)-2*x*diff(y(x),x)+(x^2+2)*y(x);
d2

d
ecuacionh := x2 2 y( x ) 2 x y( x ) + ( x2 + 2 ) y( x )
d
x

dx

> soh:=dsolve(ecuacionh,'output=basis' );
soh := [ sin( x ) x, cos( x ) x ]
> print("la solucin gral. de la homognea es: ",c1*soh[1]+c2*soh[2]);
"la solucin gral. de la homognea es: ", c1 sin( x ) x + c2 cos( x ) x
> ecuacionc:=x^2*diff(y(x),x$2)-2*x*diff(y(x),x)+(x^2+2)*y(x)-x^3*exp(x);
d2

ecuacionc := x2 2 y( x ) 2 x y( x ) + ( x2 + 2 ) y( x ) x3 ex
d
x

dx

> soc:=dsolve(ecuacionc,'output=basis' );
1

soc := [ sin( x ) x, cos( x ) x ], x ex


2

> print("la solucin gral. de la completa es: ",soc[2]+c1*soc[1,1]+c2*soc[1,2]);


"la solucin gral. de la completa es: " ,

1
2

x ex + c1 sin( x ) x + c2 cos( x ) x

You might also like