You are on page 1of 6

(usando MAPLE VI, gpo.

22-m curso 04/05)


RESOLUCIÓN DE ECUACIONES DIFERENCIALES LINEALES

EJEMPLO1.cargamos la librería para el tratamiento de ecuaciones diferenciales


> with(DEtools):
escribimos la ecuación concreta como una expresión, dándole 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 3
⎞ ⎛d 2
⎞ ⎛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));
[ [ _3rd_order, _linear, _nonhomogeneous ] ]
También es capaz de resolverla, en este caso con sus tres ctes. de integración correspondientes
> dsolve(ode1, y(x));
2 x
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 ⎞ ⎛d ⎞
ode2 := x2 ⎜⎜ 2 y( x ) ⎟⎟ + 2 x ⎜⎜ y( x ) ⎟⎟ − 6 y( x ) = 0
⎝ dx ⎠ ⎝ d x ⎠
> 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 x ⎠
5

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 ecuación `,ecu,`es del tipo: `,tipo),cat(`y su solución 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 ⎞ ⎛ d2 ⎞ ⎛d ⎞ ⎞
la ecuación ||⎜⎜ ⎜⎜ 3 y( x ) ⎟⎟ − ⎜⎜ 2 y( x ) ⎟⎟ + ⎜⎜ y( x ) ⎟⎟ − y( x ) = x2 + x ⎟⎟||es del tipo: ||
⎝ ⎝ dx ⎠ ⎝ dx ⎠ ⎝ dx ⎠ ⎠
[ [ _3rd_order, _linear, _nonhomogeneous ] ],
y su solución 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 ecuación ||⎜⎜ ( x − 3 )2 ⎜⎜ 2 y( x ) ⎟⎟ + 3 y( x ) = 2 ⎟⎟||es del tipo: ||[ [ _2nd_order, _with_linear_symmetries ] ],
⎝ ⎝ dx ⎠ ⎠
⎛ 2 ⎛1 ⎞ ⎛1 ⎞⎞
y su solución general es: ||⎜⎜ y( x ) = + _C1 x − 3 cos⎜⎜ 11 ln( x − 3 ) ⎟⎟ + _C2 x − 3 sin⎜⎜ 11 ln( x − 3 ) ⎟⎟ ⎟⎟
⎝ 3 ⎝2 ⎠ ⎝2 ⎠⎠
v)
> resuelve(diff(y(x),x$2)+10*diff(y(x),x)+25*y(x)=14*exp(-5*x)+3*x);
⎛ ⎛ d2 ⎞ ⎛d ⎞ ( −5 x ) ⎞
la ecuación ||⎜⎜ ⎜⎜ 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 ) ⎞
y su solución general es: ||⎜⎜ y( x ) = 2
( 875 x + 15 x e −6e )e + _C1 e + _C2 x 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);
⎛ ⎛ d3 ⎞ ⎛ d2 ⎞ ⎛d ⎞ y( x ) ⎞
la ecuación ||⎜⎜ x2 ⎜⎜ 3 y( x ) ⎟⎟ + 2 x ⎜⎜ 2 y( x ) ⎟⎟ − 4 ⎜⎜ y( x ) ⎟⎟ + 4 = 2 x ⎟⎟||es del tipo: ||[ [ _3rd_order, _reducible ] ],
⎝ ⎝ dx ⎠ ⎝ dx ⎠ ⎝ d x ⎠ x ⎠
⎛ 5 2 1 _C3 ⎞
y su solución general es: ||⎜⎜ y( x ) = − x + ln( x ) x2 + _C1 x + _C2 x2 + 2 ⎟⎟
⎝ 8 2 x ⎠
vii)para esta ecuación resulta más práctico aplicar el principio de superposición
> ecu:=diff(y(x),x$2)+diff(y(x),x$1)+y(x)=exp(2*x)-sin(x);
⎛ d2 ⎞ ⎛d ⎞
ecu := ⎜⎜ 2 y( x ) ⎟⎟ + ⎜⎜ y( x ) ⎟⎟ + y( x ) = e
(2 x)
− sin( x )
⎝ dx ⎠ ⎝ d x ⎠
> 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 ⎞ ⎤ 1 (2 x) ⎤
so1 := ⎢⎢ ⎢⎢ e sin⎜⎜ 3 x ⎟⎟, e cos⎜⎜ 3 x ⎟⎟ ⎥⎥, e ⎥⎥
⎣⎣ ⎝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 ⎞ (− 1 / 2 x) ⎛1 ⎞⎤ ⎤
so2 := ⎢⎢ ⎢⎢ e sin⎜⎜ 3 x ⎟⎟, e cos⎜⎜ 3 x ⎟⎟ ⎥⎥, cos( x ) ⎥⎥
⎣⎣ ⎝2 ⎠ ⎝2 ⎠⎦ ⎦

> cat(`la solución general de `,ecu,`es:


`);print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);
⎛ ⎛ d2 ⎞ ⎛d ⎞ ⎞
la solución general de ||⎜⎜ ⎜⎜ 2 y( x ) ⎟⎟ + ⎜⎜ y( x ) ⎟⎟ + y( x ) = e − sin( x ) ⎟⎟||es:
(2 x)

⎝ ⎝ dx ⎠ ⎝ dx ⎠ ⎠
1 (2 x) (− 1 / 2 x) ⎛1 ⎞ (− 1 / 2 x) ⎛1 ⎞
y= e + cos( x ) + c1 e sin⎜⎜ 3 x ⎟⎟ + c2 e cos⎜⎜ 3 x ⎟⎟
7 ⎝2 ⎠ ⎝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 ) ], − ⎥⎥
⎣ 2 k ⎦
> cat(`la solución general de `,ecu,`es:
`);print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);
⎛ ⎛ d2 ⎞ ⎞
la solución 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 )
2 k
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⎥
⎣ −k~ + b~ ⎦
2

> cat(`la solución general de `,ecu,`es:


`);print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);
⎛ ⎛ d2 ⎞ ⎞
la solución general de ||⎜⎜ ⎜⎜ 2 y( x ) ⎟⎟ + k~2 y( x ) = sin( b~ x ) ⎟⎟||es:
⎝ ⎝ dx ⎠ ⎠
sin( b~ x )
y=− 2 2
+ cos( x ) + c1 cos( k~ x ) + c2 sin( k~ x )
−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 ) +
⎝ dx ⎠ ( x + 1 )2
> print("la solución general de", ecu,"es
");print(y=so1[2]+so2[2]+c1*so1[1][1]+c2*so1[1][2]);
⎛ d2 ⎞ x
"la solución general de", ⎜⎜ 2 y( x ) ⎟⎟ + y( x ) = sin( x ) + , "es "
⎝ dx ⎠
2
(x + 1)
1 1
y= 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 2
+ c1 cos( x ) + c2 sin( x )
x

⎮ sin( t )
> Si( x ) := ⎮
⎮ dt
⎮ 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);
⎛ ⎛ d4 ⎞ ⎛ d3 ⎞ ⎛ d2 ⎞ ⎛d ⎞ ⎞
la ecuación ||⎜⎜ ⎜⎜ 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 solución 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 ⎞ ⎛d ⎞ ln( x ) ⎞⎟
la ecuación ||⎜⎜ x2 ⎜⎜ 2 y( x ) ⎟⎟ − x ⎜⎜ y( x ) ⎟⎟ − 3 y( x ) = −16
x ⎟⎠
||es del tipo: ||
⎝ ⎝ dx ⎠ ⎝ dx ⎠
[ [ _2nd_order, _exact, _linear, _nonhomogeneous ] ],
⎛ 2
1 8 ln( x ) + 4 ln( x ) + 1 _C1 ⎞
y su solución general es: ||⎜⎜ y( x ) = + + _C2 x ⎟⎟
3
⎝ 4 x x ⎠
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 ],

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 ) ⎤⎥
2 2


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));
⎛ ⎛ d4 ⎞ ⎛ d2 ⎞ ⎞
la ecuación ||⎜⎜ ⎜⎜ 4 y( x ) ⎟⎟ + 2 n~2 ⎜⎜ 2 y( x ) ⎟⎟ + n~4 y( x ) = a sin( n~ x + b ) ⎟⎟||es del tipo: ||
⎝ ⎝ dx ⎠ ⎝ dx ⎠ ⎠
⎛ 1
[ [ _high_order, _linear, _nonhomogeneous ] ], y su solución general es: ||⎜⎜ y( x ) = − a ( 4 sin( n~ x ) cos( b ) n~2 x2
⎝ 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 ⎞ ⎛d ⎞
ecuacion := ⎜⎜ 2 y( x ) ⎟⎟ − x f( x ) ⎜⎜ y( x ) ⎟⎟ + f( x ) y( x )
⎝ dx ⎠ ⎝ dx ⎠
comprobamos que y=x es solución 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);
⎡ ⌠ ( ⌠⎮x f( x ) dx ) ⎤
⎢ ⎮ ⌡ ⎥
⎢ ⎮e ⎥
sfun := ⎢⎢ x, x ⎮
⎮ 2
dx ⎥

⎢⎢ ⎮

x ⎥⎥
⎣ ⌡ ⎦
> cat(`la sol. gral. será: c`,sfun[1],` + k `,sfun[2]);
⎛ ⌠ ( ⌠⎮x f( x ) dx ) ⎞
⎜ ⎮ ⌡ ⎟
⎜ ⎮e ⎟
la sol. gral. será: cx + k ||⎜⎜ x ⎮
⎮ 2
dx ⎟

⎜⎜ ⎮⎮
x ⎟⎟
⎝ ⌡ ⎠
b)
> ecuacion:=diff(y(x),x$2)-f(x)*diff(y(x),x)+(f(x)-1)*y(x);
⎛ d2 ⎞ ⎛d ⎞
ecuacion := ⎜⎜ 2 y( x ) ⎟⎟ − f( x ) ⎜⎜ y( x ) ⎟⎟ + ( f( x ) − 1 ) y( x )
⎝ d x ⎠ ⎝ dx ⎠
comprobamos que y=exp(x) es solución 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);
⎡ ⌠ ( ⌠⎮f( x ) dx − 2 x ) ⎤
⎢ x x⎮ ⌡ ⎥
sfun := ⎢ e , e ⎮e dx ⎥
⎢ ⎮ ⎥
⎣ ⌡ ⎦
> cat(`la sol. gral. será: c`,sfun[1],` + k `,sfun[2]);
⎛ ⌠ ( ⌠⎮⌡f( x ) dx − 2 x ) ⎞
⎜ ⎮ ⎟
la sol. gral. será: c ||( e )|| + k ||⎜ ex ⎮e
x
dx ⎟
⎜ ⎮ ⎟
⎝ ⌡ ⎠
c)
> ecuacion:=x*diff(y(x),x$2)+2*diff(y(x),x)+x*y(x);
⎛ d2 ⎞ ⎛d ⎞
ecuacion := x ⎜⎜ 2 y( x ) ⎟⎟ + 2 ⎜⎜ y( x ) ⎟⎟ + x y( x )
⎝ dx ⎠ ⎝ dx ⎠
comprobamos que y=Senx/x es solución 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);
⎡ sin( x ) cos( x ) ⎤
sfun := ⎢⎢ ,− ⎥⎥
⎣ x x ⎦
> cat(`la sol. gral. será: c`,sfun[1],` + k `,sfun[2]);
⎛ sin( x ) ⎞ ⎛ cos( x ) ⎞
la sol. gral. será: c ||⎜⎜ ⎟⎟|| + k ||⎜⎜ − ⎟⎟
⎝ 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 ⎞ ⎛d ⎞
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 solución 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);
( m~ − 1 ) ( m~ − 1 )
x m~2 + x 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 147 ⎝ x ⎠ ⎦
> cat(`la sol. gral. será: `,x^4,`+c`,sfun[1],` + k `,sfun[2]);
⎛ x5 − 7 ⎞⎟ ⎛ 1 ⎛ 4 x5 − 7 ⎞ ( 3 x ) ⎞
la sol. gral. será: ||( x4 )||+c|| ⎜⎜ x4 − ⎟|| + k ||⎜⎜ ⎜⎜ x − ⎟⎟ e ⎟⎟
⎝ x ⎠ ⎝ 147 ⎝ x ⎠ ⎠
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 ⎞ ⎛d ⎞
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 solución 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) (x m) (x m ) (x m ) (x m) (x m)
expre := m2 e x2 + m2 e −2xme −e a x2 − e bx−e c
> expre:=simplify(expre/exp(m*x));
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 2
{ a = m , c = m , b = −2 m }
la ecuación 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 ⎞ ⎛d ⎞
ecuacion2 := ( x2 + 1 ) ⎜⎜ 2 y( x ) ⎟⎟ − 2 x ⎜⎜ y( x ) ⎟⎟ − y( x ) ( m2 x2 − 2 x m + m2 )
⎝ dx ⎠ ⎝ d x ⎠
> solhom:=exp(m*x):
> sfun:=reduceOrder( ecuacion2, y(x), solhom,basis);
⎡ ⎛ ( −2 x m ) 2 2
x m +4xme
( −2 x m )
+2e
( −2 x m )
⎞⎤
⎢ (x m) ⎜ 1 4 e ( −2 x m ) ⎟ ⎥
⎢ e ⎜⎜ +e ⎟⎟ ⎥
⎢ (x m) 1 ⎝4 m 2
⎠ ⎥⎥
sfun := ⎢⎢ e ,− ⎥
⎣ 2 m ⎦
> cat(`la sol. gral. será: `,`c`,sfun[1],` + k `,simplify(sfun[2]));
⎛ 1 e( −x m ) ( 2 m2 x2 + 2 x m + 1 + 2 m2 ) ⎞
(x m ) ⎜ ⎟
la sol. gral. será: c ||( e )|| + k ||⎜⎜ − ⎟⎟
⎝ 4 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 ⎞ ⎛d ⎞
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 homogénea será: `,`c`,sfun[1],` + k
`,simplify(sfun[2]));
⎛1 ⎞
la sol. gral.de la homogénea será: c ||( x ex )|| + k || ⎜⎜ x3 ex ⎟⎟
⎝2 ⎠
> ecuacionc:=ecuacionh-(6-x^2)*exp(x);
⎛ d2 ⎞ ⎛d ⎞
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 solución general de", ecuacionc,"es
");print(y=so1[2]+c1*so1[1][1]+c2*so1[1][2]);
⎛ d2 ⎞ ⎛d ⎞
"la solución 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 )
⎝ dx ⎠ ⎝ dx ⎠
> soh:=dsolve(ecuacionh,'output=basis' );
soh := [ sin( x ) x, cos( x ) x ]
> print("la solución gral. de la homogénea es: ",c1*soh[1]+c2*soh[2]);
"la solución gral. de la homogénea 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 ⎞ ⎛d ⎞
ecuacionc := x2 ⎜⎜ 2 y( x ) ⎟⎟ − 2 x ⎜⎜ y( x ) ⎟⎟ + ( x2 + 2 ) y( x ) − x3 ex
⎝ dx ⎠ ⎝ d x ⎠
> soc:=dsolve(ecuacionc,'output=basis' );
⎡ 1 ⎤
soc := ⎢⎢ [ sin( x ) x, cos( x ) x ], x ex ⎥⎥
⎣ 2 ⎦
> print("la solución gral. de la completa es: ",soc[2]+c1*soc[1,1]+c2*soc[1,2]);
1
"la solución gral. de la completa es: " , x ex + c1 sin( x ) x + c2 cos( x ) x
2

You might also like