m103ex-p-10.mw

Worked Sample Problems - Math 103

Problem 1 Find all x that satisfy 5*x-3 <= 7-3*x .

Maple can solve many inequalities, such as the one in this problem:

> solve(5*x-3<=7-3*x);

RealRange(-infinity, 5/4)

This indicates that the solution is x <= 5/4 . Note what happens when the inequality is strict: 5*x-3 < 7-3*x .

> solve(5*x-3<7-3*x);

RealRange(-infinity, Open(5/4))

Of course, this indicates that the solution is x < 5/4 .

Problem 2 Solve abs(z/5-1) <= 1 .

> solve(abs(z/5-1)<=1);

RealRange(0, 10)

Problem 3  Solve  abs(x-1) = 1-x

> solve(abs(x-1)=1-x);

RealRange(-infinity, 1)

Problems 4 We can write a little Maple program that finds the line through two points as follows:

> linethrough:=(p,q)->y=simplify(q[2]+(q[2]-p[2])/(q[1]-p[1])*(x-q[1]));

linethrough := proc (p, q) options operator, arrow; y = simplify(q[2]+(q[2]-p[2])*(x-q[1])/(q[1]-p[1])) end proc

In Maple, points are indicated with square brackets, so problem 19 is to find the line through the points [3,4] and [-2,5]:

> linethrough([3,4],[-2,5]);

y = 23/5-1/5*x

> linethrough([-8,0],[-1,3]);

y = 24/7+3/7*x

Problem 5 Here is a plot of C = 5*(F-32)/9 and C=F:

> plot({5/9*(F-32),F},F=-50..50,color=blue,thickness=2,labels=["F","C"]);

[Plot]

To find where the lines cross, we solve:

> solve(F=5/9*(F-32),F);

-40

Problem 6  To see whether a function is even or odd, we can add and subtract f(x) and f(-x) as follows:

> g:=x->x^4+3*x^2-1;

g := proc (x) options operator, arrow; x^4+3*x^2-1 end proc

> simplify(g(x)+g(-x));

2*x^4+6*x^2-2

> simplify(g(x)-g(-x));

0

Since g(x)-g(-x) is zero, the function g is even.

Problem 7 If  u(x) = 4*x-5 , v(x) = x^2 , and f(x) = 1/x , compute v(f(u(x))) , f(u(v(x))) , and f(v(u(x))) .

> u:=x->4*x-5; v:=x->x^2; f:=x->1/x;

u := proc (x) options operator, arrow; 4*x-5 end proc

v := proc (x) options operator, arrow; x^2 end proc

f := proc (x) options operator, arrow; 1/x end proc

> v(f(u(x)));

1/(4*x-5)^2

> f(u(v(x)));

1/(4*x^2-5)

> f(v(u(x)));

1/(4*x-5)^2

Problem 8 Plot sqrt(x+4) , abs(x-2) , and (x+2)^(3/2)+1 for abs(x) <= 5 , restricting the verticle axis to [-1, 10] .

Of course, Maple makes these easy - here are all the answers on one graph:

> plot({sqrt(x+4),abs(x-2),(x+2)^(3/2)+1},x=-5..5,-1..10,color=blue,thickness=2);

[Plot]

Problem 9 Plot the circle x^2+y^2-3*y-4 = 0 .

Wc can plot the circle using "implicitplot" -- be sure and use "scaling=constrained" so you don't get an ellipse:

> circ:=x^2+y^2-3*y-4=0:

> with(plots,implicitplot):

> implicitplot(circ,x=-3..3,y=-1..4,thickness=2,color=blue);

[Plot]

To find intercepts:

> solve(subs(y=0,circ),x);

2, -2

So x-intercepts are [2,0] and [-2,0].

> solve(subs(x=0,circ),y);

4, -1

and y-intercepts are [0,4] and [0,-1].

The x and y coordinates of the center must be at the averages of the x and y intercepts. (Why?) - So:

> center:=[(2-2)/2,(4-1)/2];

center := [0, 3/2]

Problem 10 Let f(x) = 5*x/(x^2+4) . Plot f(x) and f(ax) , a = 2, 3, 10 , for abs(x) <= 10 .

First we define f(x):

> f:=x->5*x/(x^2+4);

f := proc (x) options operator, arrow; 5*x/(x^2+4) end proc

> with(plots,display):

> A:=plot(f(x),x=-10..10,color=blue,thickness=4):

We made a thick copy of the graph of f to compare with the others we will make:

(a) We'll also plot f(ax) for a=2,3,10 and display them all together:

> B:=plot({f(2*x),f(3*x),f(10*x)},x=-10..10,color=red,thickness=2):

> display({A,B});

[Plot]

Apparently the bend in the middle of the graph gets sharper and bunches in toward the y-axis as a gets larger.

(b) Now we'll plot f(ax) for a=-2,-3 against the original f:

> C:=plot({f(-2*x),f(-3*x)},x=-10..10,color=red,thickness=2):

> display({A,C});

[Plot]

So the graph gets flipped (around either of the x or y axes), and bunches in as a gets more negative.

(c) Now for a=1/2, 1/3 and 1/4:

> E:=plot({f(x/2),f(x/3),f(x/4)},x=-10..10,color=red,thickness=2):

> display({A,E});

[Plot]

Now it appears that the graphs are getting "wider" - the bumps in the graph move away from the y axis (if we used small negative values of a, the graph would flip as well).

Problem 11  Plot sin(x+Pi/8) for abs(x) <= 4*Pi .

Again, plotting is easy -- just make sure to make the domain big enough to include a few periods (the period of this function is 2*Pi , of course.

> plot(sin(x+Pi/2),x=-4*Pi..4*Pi,color=blue,thickness=2);

[Plot]

Problem 12

Maple doesn't mind trig functions, so to get it to evaluate sin(Pi/8) you have to tell it to convert it to "radical" form:

> convert((sin(Pi/8))^2,radical);

1/2-1/4*2^(1/2)