Session 02
Some Calculus: Functions, Limits, and Derivatives
In the first session, we used the assignment statement (eg. y:=x^2) to create and expression. In order to evaluate such an expression, one would use the subs command. We now show another way to define a function. The following command defines a function for which it makes sense to write f(x). Each method has its good and bad points.
> f:=x->(x^3-9*x)/(x^3-x);
> plot(f(x),x=-4..4,-20..20,discont=true);
Compare this with the different plot option that plots single points.
> plot(f(x),x=-4..4,-20..20,style=point,numpoints=200);
and the regular plot command (note in this case we get vertical looking lines -Why?)
> plot(f(x), x=-4..4, -20..20); # by default discont is false
> limit(f(x),x=0);
> limit(f(x),x=1,right);
> limit(f(x),x=1,left);
> limit(f(x),x=infinity);
> limit(f(x),x=-infinity);
> Limit((3*x^2+4*x-15)/(13*x^2+32*x-21),x=-3);
Note the capitol L. This gives an unevaluated limit. To evaluate it just do the following.
> value(%);
Note for example we could write
> Limit((3*x^2+4*x-15)/(13*x^2+32*x-21),x=-3)=limit((3*x^2+4*x-15)/(13*x^2+32*x-21),x=-3);
Here is another example.
> a:=(3*x^2+4*x-15)/(13*x^2+32*x-21);
> ad:=denom(a);an:=numer(a);
> ab:=limit(ad,x=-3);at:=limit(an,x=-3);
> factor(an); factor(ad);
Note that -3 is a zero of the top and bottom.
> newa := simplify(a);
> newval:=subs(x=-3,newa);
> newval - limit(a,x=-3);
As a final indication the limit is correct, let’s plot a and the proposed limit 7/23.
> plot({a,7/23},x=-4..-2); # plot a and a line x=7/23
You can see that Maple does the necessary cancellations before calculating the limit. Note what happens if you try to plug in.
> subs(x=-3,a);
> limit(sin(x)/x,x=0);
> a:=abs(x)/x;
> plot(a,x=-2..2,-2..2);
> limit(a,x=0);
> limit(a,x=0,right); limit(a,x=0,left);
Now let us consider using the limit command together with the definition of derivative to find derivatives.
> g:='g'; f:='f'; # clear variables g and f
> g:=x->x^3-x^2+x+1;
> s:=(g(x+h)-g(x))/h;
> s1:=simplify(s);
> s2:=limit(s1,h=0);
Compare this with a Maple command for computing derivatives: diff(f,x).
> diff(g(x),x);
> D(g)(x);
But note the following. Define an expression a by assignment.
> a:=x^2+x+2;
> diff(a,x);
> D(a);
This is not what you may have expected. It is because a is defined by an assignment and not as a function.
> f:=x->sqrt(x)+1/sqrt(x);
> diff(f(g(x)),x);
> f:='f'; g:='g';
> diff(f(g(x)),x);
> f:='f';
> f:=x->x*(1-x);
> df:=x->D(f)(x);
> df(3);
> x_0:=.25;y_0:=f(.25);
> plot({f(x),df(.25)*(x-x_0)+y_0},x=0..1,0.. .3);
Implicit differentiation: (write y(x) instead of y, for implicit differentiation)
> x:='x'; y:='y';
> f1:=x^2*y(x)+cos(x*y(x))+y(x)^2;
> df1:=diff(f1,x);
> der:=solve(df1,diff(y(x),x)); # solve df1 in terms of y’(x)
Exercises
I.) Find the limits using Limit to display the problem on the left, and equal sign and then the value on the right. Then use some other method to verify the answer you obtained for the limit, e.g., use L'hopitals rule, plotting, a sequence of values converging to the limit value, etc.
In the case of problems with symbols like a or b, decide the possible cases for which the limits exist and those for which the limit doesn't exist.
1. limit(sin(a*x)/sin(b*x),x=0);
2. limit(log(cos(a*x))/log(cos(b*x)),x=0);
3. limit((3*x^2+2*x-16)/(x^2+2*x-2),x=2);
4. limit((sin(x)-x)/x^3,x=0);
5. limit((x-sin(x))/(x*sin(x))^(3/2),x=0,right);
6. limit(sin(x)/arctan(x),x=0);
7. limit((a^x-1)/(b^x-1),x=0);
8. limit(log(x)/(x^2+x-2),x=1);
9. limit((1-cos(x^2))/(x^2*sin(x^2)),x=0);
10. limit((x*(exp(x)+1)-2*(exp(x)-1))/x^3,x=0);
11. limit((log(1+x)-x)/(1-cos(x)),x=0);
12. limit(sin(Pi/2*x)*log(x)/((x^3+5)*(x-1)),x=1);
13. limit((cosh(x)-cos(x))/(x^2),x=0);
14. limit((sqrt(x)-sqrt(a)+sqrt(x-a))/(sqrt(x^2-a^2)),x=a,right);
15. limit((x*cot(x)-1)/x^2,x=0);
16. limit(sin(1/x)/atan(1/x),x=infinity,left);
17. limit(a^x/x^b,x=infinity,left);
18. limit(x^(1/4)*sin(1/sqrt(x)),x=infinity,left);
19. limit(x^2-sqrt(x^4-x^2),x=infinity,left);
20. limit(x^(x^x-1),x=0,right);
21. limit(x^(x^x),x=0,right);
22. limit((1-2^x)^(sin(x)),x=0,left);
23. limit(cot(x)^(sin(x)),x=0);
24. limit(x^(1/(1-x)),x=1);
II.) Find dy/dx using implicit differentiation.
1. x^2+xy-y^2=1; # (2,3)
2. x^2+y^2=25; # (3,-4)
3. y^2-2*x-4*y-1=0; # (-2,1)
<< Back - Next >>
|