Application Center - Maplesoft
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

App Preview:

Tangent lines and differentiability

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

L5-TangentLines.mws

Calculus I

Lesson 5: Tangent Lines and Differentiability

Example 1
For each of the following functions, we draw the graph of f(x) along with a secant and tangent line for x = a.

a) f(x) = cos(x)

> restart:

> a := 1;

a := 1

> f := x->cos(x);

f := cos

> h := 2.2;
q:= (f(a+h) - f(a))/h;
secline:= x -> f(a) + q*(x - a);
m:= D(f)(a);
tanline:= x -> f(a) + m*(x - a);

h := 2.2

q := -.4537703526-.4545454545*cos(1)

secline := proc (x) options operator, arrow; f(a)+q...

m := -sin(1)

tanline := proc (x) options operator, arrow; f(a)+m...

> plot([tanline(x), f(x), secline(x)], x=-5..5, color=[blue,green,magenta]);

[Maple Plot]

b) f(x) = x^4-1 and a = 3.

> f:= x -> x^4 -1;

f := proc (x) options operator, arrow; x^4-1 end pr...

> a:= 3;

a := 3

> h:= 2;

h := 2

> q:= (f(a+h) - f(a))/h;
secline:= x -> f(a) + q*(x - a);
m:= D(f)(a);
tanline:= x -> f(a) + m*(x - a);

q := 272

secline := proc (x) options operator, arrow; f(a)+q...

m := 108

tanline := proc (x) options operator, arrow; f(a)+m...

> plot({f(x), secline(x), tanline(x)}, x = a-1..a+3, color=[blue,red,magenta]);

[Maple Plot]

c) f(x) = sqrt(x) and a = 5.

> f:= x -> sqrt(x) ;

f := sqrt

> a:=5;

a := 5

> h:=7;

h := 7

> q:= (f(a+h) - f(a))/h; secline:= x -> f(a) + q*(x - a); m:= D(f)(a); tanline:= x -> f(a) + m*(x - a);

q := 2/7*sqrt(3)-1/7*sqrt(5)

secline := proc (x) options operator, arrow; f(a)+q...

m := 1/10*sqrt(5)

tanline := proc (x) options operator, arrow; f(a)+m...

> plot({f(x), secline(x), tanline(x)}, x= a-4..a+8, color=[blue,violet,magenta]);

[Maple Plot]

Example 2
For each of the following functions, plot f(x) and Df(x) on the same axes.

a) f(x) = x^3-7*x^2+12*x .

> f:= x -> x^3 - 7* x^2 + 12*x;

f := proc (x) options operator, arrow; x^3-7*x^2+12...

> D(f);

proc (x) options operator, arrow; 3*x^2-14*x+12 end...

> plot({D(f)(x), f(x)}, x = 0..5, color=[magenta,brown]);

[Maple Plot]

b) f(x) = |x|.

> f:= x -> abs(x);

f := abs

> D(f);

proc (a) options operator, arrow; abs(1,a) end proc...

> plot({D(f)(x), f(x)}, x = -4..4, color=[magenta,brown]);

[Maple Plot]

Example 3
Let f(x) = 2*sin(x)-cos(3*x) ; where x is from [-14,14].

a) Plot f(x) for x in [-14,1 4]. What is the period of f(x)?

> restart:

> f:= x -> 2 *sin(x) - cos(3*x);

f := proc (x) options operator, arrow; 2*sin(x)-cos...

> plot(f(x), x = -14..14);

[Maple Plot]

Period is 2*Pi .

b) Since the period of f(x) is 2*Pi , plot f(x) and D(f) on the same axes

for x in [-1,7].

> D(f);

proc (x) options operator, arrow; 2*cos(x)+3*sin(3*...

> plot({f(x), D(f)(x)}, x = -.1..7, color=[magenta,brown]);

[Maple Plot]

c) When f(x) has a max or min at x = a, what is D(f)(a)?

d) When f(x) is increasing (decreasing) what is the sign of D(f)?

When f is increasing D(f) >0, and when f is decreasing D(f) <0.

Example 4
Let f(x) = x*sin(1/x) if x > 0 and 0 if x <= 0 .

Plot f(x). Use the graph to determine whether D(f)(0) exists.

> f:= x -> piecewise( x > 0, x*sin(1/x), 0);

f := proc (x) options operator, arrow; piecewise(0 ...

> plot(f(x), x = -0.1..0.1);

[Maple Plot]

> plot(f(x), x = -.0001...0001);

[Maple Plot]

Based on the plots, we conjecture that f is not differentiable when x = 0.

Example 5
Let f(x) = x^2*sin(1/x) for x > 0 and 0 for x <= 0.

Plot f(x). Use the graph to determine if D(f)(0) exits.

> f:= x -> piecewise(x>0, x^2 * sin(1/x), 0);

f := proc (x) options operator, arrow; piecewise(0 ...

> plot(f(x), x = -.00001...00001);

[Maple Plot]

Based on the plot, we conjecture that D(f)(0) = 0.

Example 6
Let f(x) = 3-2*x^2 . Plot f(x), the tangent line when x = .5 and

the normal line when x =.5 on the same axes.

> restart:

> f:=x -> 3 - 2*x^2;

f := proc (x) options operator, arrow; 3-2*x^2 end ...

> D(f)(.5);

-2.0

> f(.5);

2.50

> t:= x -> -2*(x - .5) + 2.5;

t := proc (x) options operator, arrow; -2*x+3.5 end...

> n:= x -> (1/2)*(x - .5) + 2.5;

n := proc (x) options operator, arrow; 1/2*x+2.2500...

> plot({f(x), t(x), n(x)}, x = -1..1, color=[magenta,brown, wheat]);

[Maple Plot]

Example 7
Let f(x) = |cos(x)|. Determine where f(x) is not differentaible.

> restart:

> f:= x -> abs(cos(x));

f := proc (x) options operator, arrow; abs(cos(x)) ...

> plot(f(x), x = -7..7);

[Maple Plot]

From the plot we conjecture that f(x) is not differentiable at multiples of Pi/2 and 3*Pi/2 .