next up previous
Up: Back to the Chemistry 3730 assignment index

Assignment 1 solutions

  1. > int((x-2)*exp(-x^3),x=0..5);

    displaymath65

    > evalf(%);

    displaymath66

  2. Note that both this and the following question involve the same function, so we might as well define it as a function:
    > ts := x -> tan(sin(x));

    displaymath81

    > plot(ts,0..2*Pi);
    tex2html_wrap117
  3. > solve(ts(x)=1,x);

    displaymath67

Bonus:
There are some really easy solutions to this problem: The trigonometric functions are all tex2html_wrap_inline83 -periodic, so tex2html_wrap_inline85 is a solution for any integer n. For instance, tex2html_wrap_inline89 is a solution. Surprisingly, this didn't occur to anyone. There's another class of ``easy'' solutions, and these are the ones which some of you found: tex2html_wrap_inline91 when tex2html_wrap_inline93 for integer n. We therefore want tex2html_wrap_inline97 , with obvious solution tex2html_wrap_inline99 . There's a problem with these solutions however: For any tex2html_wrap_inline101 , |y|>1. The arcsine function is not defined over the real numbers for arguments of magnitude greater than unity. However, it is defined over the complex numbers and since I didn't specifically exclude complex solutions, these answers were technically correct and received credit.

I expected you to try to find the second solution which you can see on the graph of your function. Let's think about this for a second. The sine function looks like:

> plot(sin(x),x=0..2*Pi); tex2html_wrap119

The reason why there are two solutions should now be clear: Between 0 and tex2html_wrap_inline105 , tex2html_wrap_inline107 passes through every value between 0 and 1 twice. We just have to find a solution to the equation tex2html_wrap_inline109 with tex2html_wrap_inline111 :

> u:=arcsin(Pi/4);

displaymath68

> solve(sin(u)=sin(u+a),a);

displaymath69

Maple finds two solutions, one of which is obvious and unhelpful (0). The other one is the one we want. Let's call the second solution of the equation w:

w:=arctan(Pi*sqrt(16-Pi^2)/(-8+Pi^2))+u;

displaymath70

Let's verify this result. First of all, we'll look at the floating-point value of w and make sure that it makes sense:

> evalf(w);

displaymath71

Comparing this value to the approximate solution found by examining the graph of tex2html_wrap_inline115 , this looks right. Of course, that's not a very reliable way to go about verifying the answer. The right thing to do is to substitute w into the function ts and see what we get. It's possible to get Maple to show that this is an exact solution but it takes several steps and, after all, we're just verifying the result. It should be enough just to get the floating-point value of the function at w:

> evalf(ts(w));

displaymath72

For all intents and purposes, this is 1. The small difference is due to round-off error and is to be expected when doing finite-precision floating-point calculations.


next up previous
Up: Back to the Chemistry 3730 assignment index

Marc Roussel
Wed Sep 16 20:49:34 MDT 1998