# In this demo, we going to learn how to solve homogeneous equations by maple. > restart: # Example 1. The first example will show how to solve the second order homogeneous equation y" + y' + y =0: # Define the differential equation: > diffeq:=diff(y(t),t$2)+diff(y(t),t)+y(t)=0; # Use dsolve to solve the differential equation: > sol:=dsolve(",y(t)); # Observe that the solution is a linear combination of the two fundamental solutions. We set _C1= 1 and _C2=0 to extract the first # fundamental solution. Then set _C1=0 and _C2=1 to extract the other fundemantal solution. > y1:=rhs(subs({_C2=0,_C1=1},sol)); > y2:=rhs(subs({_C2=1,_C1=0},sol)); # Example 2. For higher order equations, dsolve is not adequate. We are now going to solve y'''' + y' + y =0: # First define the forth order differential equation: > diffeq:=diff(y(t),t$4)+diff(y(t),t)+y(t)=0; > sol:=dsolve(",y(t)); # The summation we got above is over all the complex roots of _Z^4 + _Z + 1 = 0. So, to get the fundamental set of real solutions, we # need to solve _Z^4 + _Z + 1 = 0 first. > ev:=fsolve(r^4+r+1=0,r,complex); # Then substitute each of the complex root into e^(rt): > Y1:=evalc(exp(ev[1]*t)); > Y2:=evalc(exp(ev[2]*t)); > Y3:=evalc(exp(ev[3]*t)); > Y4:=evalc(exp(ev[4]*t)); # We then observe that Y1 and Y2, Y3 and Y4 form two conjugate pairs. To obtain the fundamental set of real solutions, we may take the # linear combination of Y1 and Y2: > y1:=(Y1+Y2)/2; > y2:=(Y2-Y1)/(2*I); # Or we may use Re and Im to extract the real and imaginary parts of a complex expression. > y3:=evalc(Re(Y3)); > y4:=evalc(Im(Y4)); # y1, y2, y3 and y4 then form a fundamental set of real solutions to our 4th order equation. >