3 eqn1:a*cos(p2)=s+b*cos(p3);
4 eqn2:a*sin(p2)=e+b*sin(p3);
5 /* declare p2, p3 and s to be time-dependent. */
7 /* [1] from equations 1 and 2, eliminate p3: */
8 eqn3:expand((eqn1-s)^2+(eqn2-e)^2);
10 /* [2] using the results of step 1, solve for s in terms of
12 s_solution:solve(eqn3,s);
13 /* note that this differs from the result given.
14 [3] take the derivative of eqn2 wrt t: */
16 /* [4] solve for p3-dot in terms of a, b, p2, p2-dot,p3. */
17 p3_dot:solve(%,diff(p3,t));
18 /* [5] take the derivative of eqn2 wrt t: */
20 /* [6] solve for s-dot in terms of a, b, p2, p2-dot,p3. */
21 solve(eqn5,diff(s,t));
25 z:i*(a*cos(p2)/(b*cos(p3)))^2;