Homework 6:

Needs["Algebra`Trigonometry`"]

conjugate::usage = 
" A simple method of computing the conjugate of an object
 which is explicitly Complex";

conjugateRule     = {Complex[re_,im_]:>Complex[re,-im]};
conjugate[exp__] := exp /. conjugateRule;

Not complete: 
You must fill in missing steps:

Problem 1:

Clear["Global`*"];

Part a)

(* Replace: w0^2 = k/m *)

mSol= Solve[w0^2 == k/m ,m][[1]]

eq1= m x''[t] + k x[t] == 0 /.mSol

dSol= DSolve[eq1,x,t][[1]];
{x[t], x'[t], x''[t]} /.dSol //TableForm

Part b) 
I'll do this in general first.

{position,velocity,acceleration}= 
     {x[t], x'[t], x''[t]} /.dSol  //ComplexToTrig //Simplify

Plot[{position,velocity,acceleration} /.{w0->2} //Evaluate
    ,{t,0, 2 Pi}
    ,PlotStyle->{{},{Dashing[{0.020}]},{Thickness[0.008]}}
    ];

Part c)

{kinetic, potential, total} = 
 {1/2 m velocity^2 , 1/2 k position^2, 
  1/2 m velocity^2 + 1/2 k position^2}

Plot[{kinetic, potential, total} /.{w0->2, k->4} //Evaluate
    ,{t,0, 2 Pi}
    ,PlotStyle->{{},{Dashing[{0.020}]},{Thickness[0.008]}}
    ];

Part d)

ParametricPlot[{position,velocity} /.{w0->2} //Evaluate
            ,{t,0, 2 Pi}];

Problem 4:

Clear["Global`*"];

Part a)

(* Short cut: Don't put in the "==" yet. *)

eq1= L q''[t] + R q'[t] + 1/C q[t] - e0 Exp[I w t]

eq2= D[eq1,t]

(* Use c for current: *)

qRule= {q-> (Integrate[c[#],#]&) }

{q[t], q'[t], q''[t], q'''[t]} /.qRule

Part e)

values= {L->L0, C -> 300 10^-12, R ->5, w0-> 2 Pi 10^4};

mag= impedance (impedance //conjugate) //Simplify

Problem 5:

Clear["Global`*"];

Part a)

Plot[({x1[t],x2[t],x3[t]} //Re)  //Evaluate 
    ,{t,0,20}
    ,PlotStyle->{{},{Dashing[{0.020}]},{Thickness[0.008]}}
    ];

Problem 6:

Clear["Global`*"];

Part a)

fun[c0_,c1_,c2_,c3_]:= 
 ( c0 
 + c1 Sin[2 Pi 1 x]
 + c2 Sin[2 Pi 2 x]
 + c3 Sin[2 Pi 3 x]
 )

doit[c0_,c1_,c2_,c3_]:= Plot[ fun[c0,c1,c2,c3] //Evaluate ,{x,0,1}];

doit[1,2,3,4];

Problem 7:

Clear["Global`*"];

Part a)

Plot[Ceiling[x+1/2],{x,0,1}];

Problem 8:

Clear["Global`*"];

Part a)

Plot[1-Abs[x],{x,-1,1}];