Sp2016 Practice Final:  8 questions - 12 or 13 points each - 100 points total.
Name_________________

Show matrices etc. you enter in calculators and explain what you did. 
No points for dsolve. 
No imaginary numbers in final answers.
Read the instructions.
Use the back of a page to show more work if you need to.

Notes: 
If I give you the eigenvalues and eigenvectors of a matrix use them.
If I give you solutions to part of the problem use them. 
I may try to save you time by asking you just to show me a matrix that you would row reduce.

({{Total, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8}, {      ,  ,  ,  ,  ,  ,  ,  ,  }})

Solve the Initial Value Problem ({{X', =, (({{11, -4, 2}, {20, -7, 6}, {8, -4, 5}})).X, +, (({{12 (e^t)}, {0}, {cos(2t)}}))}})  
Write down the matrix you would row reduce to satisfy X[0]=(({{1}, {2}, {3}})).

A=(({{11, -4, 2}, {20, -7, 6}, {8, -4, 5}}));  xp1[t_]:= {a1,a2,a3}(E^t)
SolveAlways[ xp1'[t]==A.xp1[t]+{12 (E^t),0,0},t]
xp2[t_]:={b1,b2,b3} Cos[2 t] + {d1,d2,d3} Sin[2 t]
Id=IdentityMatrix[3];
sol=LinearSolve[ 
ArrayFlatten[ (({{-2 Id , -A}, {-A,  2 Id}}))],
{0,0,0,0,0,1}]
N[sol]

Solve the Initial Value Problem ({{X', =, (({{6, -32, -4}, {0, -4, 0}, {1, -16, 2}})).X, +, (e^(3t))(({{1}, {0}, {9}}))}})  satisfying X[0]=(({{8}, {6}, {4}})).

A=(({{6, -32, -4}, {0, -4, 0}, {1, -16, 2}}));
LinearSolve[ A- 3 IdentityMatrix[3], -{1,0,9}]

({{Score}, {      }})

Solve the Ordinary Differential Equation ({{X', =, (({{-8, 22, 0}, {0, 3, 0}, {22, -44, 3}})).X, +, (({{1}, {2t}, {3}}))}}) 
Write down the matrix you would row reduce to satisfy X[0]=(({{3}, {2}, {1}})).

A= (({{-8, 22, 0}, {0, 3, 0}, {22, -44, 3}}));
LinearSolve[ A,{3,2,1}]

({{Score}, {      }})

Solve (dQ/dt)=(e^(Q-2t))                 Q(3)=4

Simplify[-(E^(-Q[t]))/.DSolve[ {Q'[t]==(E^(Q[t]-2 t)),Q[3]==4},Q[t],t][[1]]]

({{Score}, {      }})

Solve (dy/dx)=y-(x^3)                y(2)=3

DSolve[ {y'[x]==y[x]-(x^3)},y[x],x]//Simplify

({{Score}, {      }})

Solve (1+2 (e^(x+2 y)))y'=-((e^(x+2 y))+3 (x^2))                 y(1)=4

f[x_,y_]= (x^3)+y + (E^(x + 2 y));
D[ f[x,y],{{x,y}}]
f[1,4]

({{Score}, {      }})

Solve y'-cos(x)y=2 cos(x)                 y(π/2)=1

DSolve[ {y'[x]- Cos[x] y[x]==2 Cos[x],y[π/2]==1}, y[x],x][[1]]

({{Score}, {      }})

Solve 
( 2 y+(1/(1+(((x+y))^2))))(dy/dx)=- ((1/(1+(((x+y))^2)))+ cos(x))             y(1)=3

Clear[x,y]
D[ ArcTan[ x+y]+(y^2)-Sin[x],{{x,y}}]

({{Score}, {      }})

Use Euler method to obtain a 4 decimal approximation of y(-0.8) for 
y'=2y+(e^(-x)) with y(-1)=0.2. 
First use h=0.1 and then h=0.05. Find an explict solution for the initial value problem and fill in the tables.

({{Score}, {      }})

Clear[y,x,ySol]
f[x_,y_]:= 2 y +  (E^(-x))
ySol[x_]=Expand[ y[x]/.DSolve[ {y'[x]==f[x,y[x]],y[-1]==0.2},y[x],x][[1]]]
h=0.1;
{x,y}={-1,0.2};
TableForm[
Join[ {{x,y,0.3,0.0,0.0}},
Table[
{x,y}={x,y}+h {1, f[x,y]};
{x,y,ySol[x],Abs[y-ySol[x]], 100Abs[y-ySol[x]]/Abs[ySol[x]]},
{2}]
],
TableHeadings->{Automatic,{"(Subscript[x, n])", "(Subscript[y, n])", "Actual Value", "Abs. Error", "%Relative Error"}}
]
h=0.05;
{x,y}={-1,0.2};
TableForm[
Join[ {{x,y,0.3,0.0,0.0}},
Table[
{x,y}={x,y}+h {1, f[x,y]};
{x,y,ySol[x],Abs[y-ySol[x]], 100Abs[y-ySol[x]]/Abs[ySol[x]]},
{4}]
],
TableHeadings->{Automatic,{"(Subscript[x, n])", "(Subscript[y, n])", "Actual Value", "Abs. Error", "%Relative Error"}}
]

Solve y'''+ 5 y''+22 y'+48y=x

Expand[ y[x]/.DSolve[ y'''[x]+ 5 y''[x]+22 y'[x]+ 48 y[x]==x,y[x],x][[1]] /.C[i_]->0 ]

({{Score}, {      }})

Solve y''-9 y = cos(2t)+(e^(3t))

Expand[y[x]/.DSolve[ y''[x]- 9 y[x]== Cos[2x] +(E^(3x)), y[x],x][[1]]/.{C[1]->0,C[2]->0}]

D[ x (E^(3 x)),{x,2}]

({{Score}, {      }})

Solve 4 y''[x]+y[x]=Sec[x/2]

Clear[x,y]
y[x]/.DSolve[ 4 y''[x]+ y[x]== (1/(Cos[x/2])),y,x][[1]]/.{C[1]->0,C[2]->0}//Simplify

({{Score}, {      }})

How to Make Pretty Matrices

A=(({{3, 0, 0}, {0, 3, 0}, {0, 0, -8}}));
X=RandomInteger[{-2,2},{3,3}];
MatrixForm[A=Inverse[X].A.X]
Eigensystem[A]

A=(({{3, 2, 0}, {-2, 3, 0}, {0, 0, 3}}));
X=RandomInteger[{-2,2},{3,3}];
MatrixForm[A=Inverse[X].A.X]
Eigensystem[A]

A=(({{4, 1, 0}, {0, 4, 0}, {0, 0, -4}}));
X=RandomInteger[{-2,2},{3,3}];
MatrixForm[A=Inverse[X].A.X]
Eigensystem[A]