Chapter 3 	Differentiation

3.1   The Derivative

Students should read Sections 3.1-3.5 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

3.1.1  Slope of Tangent

The derivative is one of the most fundamental concepts in calculus.  Its pointwise definition is given by

f' (a)=(lim_(h->0))(( f(h+a)-f(a))/h)

where geometrically f'(a) is the slope of the line tangent to the graph of f(x) at x=a (provided the limit exists).  We can view this graphically in the illustration below, where the tangent line (shown in blue) is viewed as a limit of secant lines (one shown in red) as h->0.

Example 3.1. Calculate the derivative of f(x)=((x^2)/3) at x= 1 using the pointwise definition of a derivative.

Solution: We first use the Table command to tabulate slopes of secant lines passing through the points at  a=1 and a+h=1+h by choosing arbitrarily small values for h (taken as reciprocal powers of 10):

f[x_]=x^2/3;
a=1;
h=10^(-n);
TableForm[N[Table[{h,((f[a+h]-f[a])/h)},{n,1,5}]]]

Note our use of the TableForm command, which displays a list as an array of rectangular cells.  From the table output, we  infer that f'(1)=2/3.  A more rigorous approach is to algebraically simplify the difference quotient,((f(a+h)-f(a))/h):

Clear[h]
Simplify[((f[a+h]-f[a])/h)]

It is now clear  that ((f(a+h)-f(a))/h)->(2/3)as h->0.  This can be checked using Mathematica's Limit command:

Limit[((f[a+h]-f[a])/h),h->0]

Below is a plot of the graph of f(x) (in black) and its corresponding tangent line (in blue), which also confirms our answer:

Plot[{f[x],f'[a](x-a)+f[a]},{x,-2,2},PlotStyle->{Black,Blue}]

NOTE: Recall that the tangent line of f(x) at x=a is given by the equation y=f'(a)(x-a)+f(a).

ANIMATION: Evaluate the following inputs to see animations of the secant lines approach the tangent line (from the right and left).

Important Note: If you are reading the printed version of this publication, then you will not be able to view any of the animations generated from the Animate command in this chapter.  If you are reading the electronic version of this publication formatted as a Mathematica Notebook, then evaluate each Animate command to view the corresponding animation.  Just click on the arrow button to start the animation.  To control the animation just click at various points on the sliding bar or else manually drag the bar.

(* From the right *)
fa1[x_]:=x^2/3;
a1=1;
Animate[Plot[{fa1[x],fa1'[a1](x-a1)+fa1[a1],(fa1[a1+h]-fa1[a1])/h*(x-a1)+fa1[a1]},{x,0,2},PlotStyle->{Black,Blue,Red}],{h,1.5,0.1,-0.05}]

(* From the left *)
fa1[x_]:=x^2/3;a1=1;
Animate[Plot[{fa1[x],fa1'[a1](x-a1)+fa1[a1],(fa1[a1+h]-fa1[a1])/h*(x-a1)+fa1[a1]},{x,0,2},PlotStyle->{Black,Blue,Red}], {h,-1.0,-0.1,0.05}]

3.1.2  Derivative as a Function

The derivative is best thought of as a slope function, one that gives the slope of the tangent line at any point on the graph of f(x) where this slope exists:

f' (x)=(lim_(h->0))(( f(x+h)-f(x))/h).

Example 3.2. Compute the derivative of f(x)=sin x using the limit definition.

Solution: We first simplify the corresponding difference quotient to obtain

Clear[h]
f[x_]=Sin[x];
Simplify[(f[x+h]-f[x])/h]

Here, it is not clear what the limit of the difference quotient is as h->0.  To anticipate the answer for the derivative without algebraic manipulation, we first note that since sin x is periodic, so should its derivative be.  A plot of the difference quotient (as a function of x) for several arbitrarily small values of h reveals the derivative to be cos x.  Students should recognize from trigonometry that the graph of cos x is merely a left horizontal translation of sin x by (π/2).

plot1=Plot[{f[x],Cos[x]},{x,-Pi,Pi},PlotStyle->{Black,Blue}]

Clear[h]
plot2=Plot[Evaluate[Table[(f[x+h]-f[x])/h,{h,0.1,0.7,0.3}]],{x,-Pi,Pi},PlotStyle->Red]

Show[plot1,plot2]

Of course, there are a number of methods to compute the derivative directly in Mathematica.   One method is to evaluate the command D[f,x]  for a function f defined with respect to the variable x.  A second method is to merely evaluate the expression f'[x] using the traditional prime (apostrophe symbol) notation.  A third method is to use the command  (∂_□) □.  We shall only discuss the first two methods since the third method is usually reserved for derivatives of functions depending on more than one variable, a topic that is treated in the third volume of this publication.

Example 3.3. Compute the derivative of sin ((x^2)) and evaluate it at x= (Sqrt[(π/4)]).

Solution:

Method 1:

D[Sin[x^2],x]
D[Sin[x^2],x]/.x->Sqrt[Pi/4]

NOTE: Recall the substitution command /.x->a was discussed in an earlier section.

Method 2:

f[x_]=Sin[x^2]
f'[x]
f'[Sqrt[Pi/4]]

Warning: Observe that the derivative of sin ((x^2)) is NOT cos ((x^2)) but 2x cos ((x^2)).  This is because sin ((x^2)) is a composite functsion.  A rule for differentiating composite functions, known as as the Chain Rule, is discussed in ection 3.7 of Rogawski's Calculus.

Example 3.4. Compute the derivative of f(x)={({{((sin x)/x), if x≠0}, {0, if x=0}}).

Solution: To define functions described by two different formulas over separate domains, we employ Mathematica's If[expr, p, q] command:

f[x_]=If[x≠0,Sin[x]/x,0]

f'[x]

NOTE: It is clear for x≠0 that the derivative is -((sin x)/(x^2)) + ((cos x)/x) as a result of the Quotient Rule.  For x=0, Mathematica's answer that f'(0)=0 is actually incorrect!  Note that the fact that f(0)=0 does not mean that f is a constant. One cannot differentiate a formula that is valid at only a single point; it is also necessary to understand how the function behaves in a neighborhood of this point.

A plot of the graph of f(x) reveals that it is discontinuous at x=0, that is, (lim_(x->0))f(x)≠f(0), and thus not differentiable there.

Plot[f[x],{x,-3Pi,3Pi}]

Observe that the point f(0)=0 is not distinguished in the Mathematica plot above so that the (removable) discontinuity is detected only by examining the behavior of f around x=0 (the true graph of f is shown following).

In particular, f(x)->1 as x->0.  We confirm this with Mathematica.

Limit[f[x],x->0]

Of course, it is also possible to compute f'(0) directly from the limit definition.  Here, the difference quotient behaves as ((sin h)/(h^2)) as the output below shows.  Since its limit does not exist as h->0, we conclude that f'(0) is undefined.

Simplify[(f[0+h]-f[0])/h]
Limit[(f[0+h]-f[0])/h,h->0]

NOTE: The discontinuity of f at x=0 can be removed by redefining it there to be f(0)=1.  What is f'(0) in this case?

Example 3.5  Find the equation of the tangent line to the graph of f(x) = (Sqrt[x+1]) at  x = 2.

Solution:  Remember that the tangent line to a function f(x) at x = a  is L(x) = f(a) + f '(a) (x-- a). Hear  a = 2:

Clear[f,L]
f[x_] = (Sqrt[x + 1])
L[x_] = f[2] + f'[2](x - 2)

To see that L(x) is indeed the desired tangent line, we will plot f and L together.

Plot[{f[x], L[x]},{x,0,4}]

Example 3.6. Find an equation of the line passing through the point P(2,-3) and tangent to the graph of f(x)=(x^2)+1.

Solution: Let us refer to Q(a,f(a)) as the point of tangency for our desired tangent line.  To determine Q, we compute the slope of our desired tangent line from two different perspectives:

1. Slope of line segment  PQ:

Clear[a]
f[x_]=x^2+1
m=(f[a]-(-3))/(a-2)

2. Derivative of f(x) at x=a:

f[x_]=x^2+1
f'[a]

Equating the two formulas for slope above and solving for a yields

Solve[m==f'[a],a]
N[%]

Since there are two valid solutions for a, we  have in fact found two such tangent lines.  Their equations are given by

Clear[y1,y2]
y1[x_]=Simplify[f'[a](x-a)+f[a]/.a->2 (1-(Sqrt[2]))]
y2[x_]=Simplify[f'[a](x-a)+f[a]/.a->2 (1+(Sqrt[2]))]

Plotting these tangent lines together with the graph of f(x) confirms that our solution is correct:

Plot[{f[x],y1[x],y2[x]},{x,-6,6},PlotRange->{-10,40},PlotStyle->{Black, Blue,Blue}]

NOTE: How would the solution change if we move the given point in the problem to P(2,5)?  Or P(2,10)?

Exercises

In Exercises 1 through 3, compute the derivatives of the given functions:
1.  f(x)= 3(x^2)+1	  2.  g(x)=(1/(x^3))		3.  h(x)=((sin x)/(cos x))

In Exercises 4 and 5, evaluate the derivatives of the given functions at the specified values of x:
4.  f(x)=(x-1)(x+1) at x=1		5.  g(x)=(((Sqrt[x])+1)/((Sqrt[x])-1)) at x=9

In Exercises 6 and 7, compute the derivatives of the given functions:
6.  f(x)=|x+3| 		7.  g(x)=|(x^2)-4| 
Hint: Recall the absolute value function: |x|={({{x, if x ≥0}, {-x, if x <0}}).  Use the If command to define these absolute functions (see Example 3.4).  Note that Mathematica does have a built-in Abs[x] command for defining the absolute value of x, but Mathematica treats Abs[x] as a complex function; thus its derivative Abs'[x] is NOT defined.  The real derivative of Abs[x] for real values of x can still be found using the numerical derivative ND command but we shall not discuss it here.

8.  Find an equation of the line tangent to the graph of x-(y^2)=0 at the point P(9,-3).

9.  Find an equation of the line passing through the point P(2,-3) and tangent to the graph of y=(x^2).

3.2.	Higher-Order Derivatives

Students should read Section 3.5 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

Suppose one is interested in securing higher order derivatives of a function.  Reasons for doing so include applications to maximum and minimum values, points of inflection, and physical applications such as velocity and acceleration and jerk, which all fit into such a context.

Example 3.6. Compute the first eight derivatives of f(x)=sin x.  What is the 255th derivative of f?

Solution: Here are the first eight derivative of f:

f[x_]=Sin[x];
TableForm[Table[{n,D[f[x],{x,n}]},{n,1,8}]]

We observe from the output that the higher-order derivatives of f are periodic modulo 4, which means they repeat every four derivatives. Since 255 has remainder 3 when divided by 4, it follows that (f^((255)))(x)=(f^((3)))(x)=-cos x.  Of course, Mathematica can compute this derivative directly (see  output below), but the pattern above gives us a more in-depth understanding of the higher-order derivatives of sin x.

D[f[x],{x,255}]

Example 3.7. Compute the first three derivatives of f(x)=x cos x .

Solution: We use the command D[f,{x,n}] to compute the nth derivative of f.  Here, we set n=1, 2, 3.

f[x_]=x*Cos[x]

D[f[x],x]

D[f[x],{x,2}]

D[f[x],{x,3}]

A quicker way to generate a list of higher-order derivatives is to use the Table command.  For example, here is a list of the first five derivatives of f:

Table[D[f[x],{x,n}],{n,1,5}]

Discovery Exercise: Find a formula for the nth derivative of f based on the pattern above.   Can you prove your claim using mathematical induction?  What is the 100th derivative of f in this case?   Check your answer using Mathematica.

Exercises

1. Let f(x)=1/x.
a) Compute the first five higher-order derivatives of f.
b) What is the 10th derivative of f?
c) Obtain a general formula for the nth derivative based on the pattern.  Then use the principle of mathematical induction to justify your claim.

2.  Consider f(x)=x sin x.  Determine the first eight derivatives of f and obtain a pattern. Justify your contention.

In Exercises 3 and 4, compute (f^((k)))(x)  for k = 1,2,3,4.
3.   f(x) = (((1 + (x^2)))^(6/5))
4 .  f(x) = ((1-(x^2))/(1-3x+2(x^3)))

3.3	Chain Rule and Implicit Differentiation

Students should read Sections 3.7 and 3.10 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

In this section, we demonstrate not only how Mathematica uses the Chain Rule to differentiate composite functions but also to compute derivatives of functions defined implicitly by equations where solving for the dependent variable is not feasible.

Example 3.8. Find all horizontal tangents of f(x)=(Sqrt[(((x^4)-x+1)/((x^4)+x+1))]) .

Solution: We first compute the derivative of f, which requires the Chain Rule.

f[x_] := (Sqrt[(((x^4) - x +1)/((x^4)+ x + 1))]);
Simplify[f'[x]]

Horizontal tangents have zero slope and so it suffices to solve f'(x)=0 for x.

Solve[f'[x]==0,x]

Observe that the solutions above are nothing more than the zeros of the numerator of f'(x).  We ignore the second and third solutions listed above, which are imaginary.  Hence, x=((1/3)^(1/4)) ≈ 0.76  and x=-((1/3)^(1/4)).  A plot of the graph of f below confirms our solution.

Plot[f[x],{x,-2,2}]

Example 3.9.  Find all horizontal tangents of the lemniscate described by 2((((x^2)+(y^2)))^2)=25((x^2)-(y^2)).

Solution: Implicit differentiation is required here to compute ((d y)/(d x)), which involves first differentiating the lemniscate equation and then solving for our derivative.  Observe that we make the substitution y->y(x), which makes explicit our assumption that y depends on x.

Clear[x,y]
eq=2(x^2+y^2)^2==25(x^2-y^2)

2 ((((x^2)+(y^2)))^2)==25 ((x^2)-(y^2))

deq=D[eq/.y->y[x],x]

Solve[deq,y'[x]]

To find horizontal tangents, it suffices to find where the numerator of y'(x) vanishes (since the denominator never vanishes except when y=0).  Thus, we solve the system of equations 25x-4(x^3)-4x (y^2)=0 and 2((((x^2)+(y^2)))^2)=25((x^2)-(y^2))  since the solutions must also lie on the lemniscate.

Solve[{eq,25x-4x^3-4x*y^2==0},{x,y}]

From the output, we see that there are four valid solutions at (5(Sqrt[3])/4,5/4)≈(2.17, 1.25), (-5(Sqrt[3])/4,5/4), (5(Sqrt[3])/4,-5/4), and (-5(Sqrt[3])/4,-5/4), which can be confirmed by inspecting the graph of the lemniscate below.  Observe the symmetry in the solutions.

N[5*Sqrt[3]/4]

ContourPlot[2(x^2+y^2)^2==25(x^2-y^2),{x,-4,4},{y,-2,2}]

Exercises

1. Find all horizontal tangents of  g(x)=(((((x^2)/(x+1))))^7).

2. Find all tangents along the curve  h(x)=(Sqrt[x+(Sqrt[x])]) whose slope equals 1/2.

3. Find all vertical tangents of the cardioid described by (x^2)+(y^2)=(((2(x^2)+2(y^2)-x))^2).

4. Compute the first and second derivatives of

f(x)={({{x cos(1/x), if x≠0}, {0, if x=0}}).

5. Compute the first and second derivatives of

g(x)={({{(x^2) cos(1/x), if x≠0}, {0, if x=0}}).

How do these derivatives at the origin compare with those in the previous exercise?

6. Based on your investigations of the previous two exercises, explain the behavior of higher-order derivatives of

h(x)={({{(x^n) cos(1/x), if x≠0}, {0, if x=0}})

at the origin for positive integer values of n.

7.  Calculate the implicit derivative of y with respect to x of:  x(y^2) + (x^2)(y^4)-- (x^3) = 5.

8.  Plot ((((x^2) + (y^2)))^2)=((x^2)-(y^2))+2  for -4 ≤ x ≤ 4  and  -4 ≤ y ≤ 4.  Then determine how many horizontal tangent lines the curve appears to have and find the points where these occur.

3.4	Derivatives of Inverse, Exponential, and Logarithmic Functions

Students should read Sections 3.8-3.9 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

Exponential functions arise naturally. For example, mathematical models for the growth of a population or the decay of a radioactive substance involve exponential functions. In this section, we will explore exponential functions and their inverses, called logarithmic functions, using Mathematica.  We begin with a review of inverse functions in general.

3.4.1.  Inverse of a Function

Recall that a function g(x) is the inverse of a given function f(x) if f(g(x))=g(f(x))=x.  The inverse of f(x) is denoted by (f^(-1))(x). We note that a necessary and sufficient condition for a function to have an inverse is that it must be one-to-one. On the other hand, a function is one-to-one if it is strictly increasing or strictly decreasing throughout its domain.

Example 3.13.  Determine if the function f(x)=(x^2)-x+1 has an inverse on the domain (-∞,∞). If it exists, then find the inverse.

Solution: We note that f(0)=f(1)=1. Thus, f is not one-to-one. We can also plot the graph of f and note that it fails the Horizontal Line Test since  it is not increasing on its domain.

Clear[f,g]

f[x_]=x^2-x+1;
Plot[f[x],{x,-1,2}]

However, observe that if we restrict the domain of f to an interval where f is either increasing or decreasing, say [0.5,∞), then its inverse exists (see plot below).

plotf=Plot[f[x],{x,0.5,5}]

To find the inverse on this restricted domain, we set y=(f^(-1))(x).   Then f(y)=x. Thus, we solve for y from the equation f(y)=x.

sol=Solve[f[y]==x,y]

Note that Mathematica gives two solutions. Only the second one is valid, having range [0.5,∞), which agrees with the domain of f.  Thus,
				(f^(-1))(x)=  (1/2)(1+(Sqrt[-3+4x])).
To extract this solution from the above output, we use the syntax below and denote the inverse function in Mathematica by g(x) (Mathematica interprets the notation (f^(-1))(x) as (1/(f(x))), the reciprocal of f).

g[x_]=sol[[2,1,2]]

To verify that  f(g(x))=x, we use the Simplify command.

Simplify[f[g[x]]==x]

NOTE: One can also attempt to verify g(f(x))=x.  However, Mathematica cannot confirm this identity (see output below) because it is unable to simplify the radical, which it treats as a complex square root.  Students are encouraged to algebraically check this identity on their own.

Simplify[g[f[x]]==x]

Lastly, a plot of the graphs of f(x) and g(x) (in black and blue, respectively) shows their expected symmetry about the diagonal line y=x (in red).  Observe that the domain of g is [3/4,∞), which is the range of f.

plotg=Plot[g[x],{x,3/4,5}, PlotStyle->Red,AspectRatio->Automatic]

Show[plotf,plotg,Graphics[{Dashing[{0.05,0.05}],Line[{{0,0},{5,5}}]}],PlotRange->{0,5},AspectRatio->Automatic]

Example 3.14.  Determine if the function f(x)=(x^3)+x has an inverse. If it exists, then compute ((f^(-1)))'(2).

Solution: Since f'(x)=3(x^2)+1>0 for all x, we see that f is increasing on its domain. Thus, it has an inverse. Again, we can solve for this inverse as in the previous example:

Clear[f,g,x,sol]
f[x_]:=x^3+x
sol=Solve[f[y]==x,y]

Only the first solution listed above is valid, being real valued.  Thus,
				(f^(-1))(x)=  -(((((2/3)))^(1/3))/(((9 x+(Sqrt[3]) (Sqrt[4+27 (x^2)])))^(1/3)))+((((9 x+(Sqrt[3]) (Sqrt[4+27 (x^2)])))^(1/3))/((2^(1/3)) (3^(2/3)))).
Again we denote our inverse by g(x):

g[x_]=sol[[1,1,2]]

Lastly, we compute g'(2).

Simplify[g'[2]]
N[%]

NOTE: The easier approach in computing g'(2) without having to explicitly differentiate g(x) is to instead use the relation ((f^(-1)))'(x)=1/f'((f^(-1))(x)), which shows that the derivative of f at a point (a,b) on its graph and the derivative of (f^(-1)) (or g in our case) at the corresponding inverse point (b,a) on its graph are reciprocal.  In particular, since f(1)=2 and (f^(-1))(2)=1, we have ((f^(-1)))'(2)=1/f'((f^(-1))(2))=1/f'(1)=1/4.

1/f'[g[2]]
N[%]

NOTE: The plot below illustrates how the slopes of the two tangent lines, that of f at (1,2) and that of g at (2,1) (both in blue), are reciprocal.

Plot[{f[x],g[x],f'[1](x-1)+f[1],g'[2](x-2)+g[2]},{x,-1,5},PlotRange->{-1,5},PlotStyle->{Black,Red,Blue,Blue},AspectRatio->Automatic]

3.4.2.  Exponential and Logarithmic Functions

One of the most important functions in mathematics and its applications is the exponential function. In particular, the natural exponential function f(x)=(e^x), where

e=(lim_(x->0))(((1+x))^(1/x))≈2.718.

In Mathematica, we use the capital letter E or blackboard bold letter e from the Basic Math Input submenu of the Palettes menu to denote the Euler number.

Limit[(1+x)^(1/x),x->0]

Every exponential function f(x)=(a^x), a≠1, a>0, where a≠1 and a>0, has domain (-∞,∞) and range (0,∞). It is also one-to-one on its domain. Hence, it has an inverse.  The inverse of an exponential function f(x)=(a^x) is called the logarithm function and is denoted by g(x)=(Subscript[log, a]) x. The inverse of the natural exponential function is denoted by g(x)=ln x and is called the natural logarithm. In Mathematica, we use Log[a,x] for (Subscript[log, a]) x and Log[x] for ln x.  Below is a plot of the graphs of (e^x) and ln x in black and red, respectively.  Observe their symmetry about the dashed line y=x.

Please refer to Section 3.9 of Rogawski's Calculus textbook for derivative formulas of general exponential and logarithmic functions.

Example 3.15.  Compute derivatives of the following functions.
a) f(x) = (2^x) 	b) f(x)=6(x^2)+4(e^x)	c) f(x) =(Subscript[log, 10])(x^2)	d) f(x)=ln(cos((e^(3x))))

Solution: We will input the functions directly and use the command D to find each derivative. Thus, for a) we will evaluate D[(2^x),x].  Again, note that Log[2] should be read as ln 2.

a)

D[2^x,x]

b)

D[6(x^2)+4(E^x),x]

c)

D[Log[10,x^2],x]

d)

f=D[Log[Cos[(E^(3x))]],x]

Example 3.16.  Find points on the graph of f(x)=(x^2)(e^(3x+5))+3x where  the tangent lines are parallel to the line y=3x-1.

Solution: Since the slope of the given line equals 3 it suffices to solve f'(x)=3 for x to locate these point(s).

Clear[f,sol]
f[x_]=(x^2)(E^(3x+5))+3x
sol=Solve[f'[x]==3,x]

Thus there are two solutions: (-2/3,-2+4(e^3)/9) and (0,0).

x0=sol[[1,1,2]]
x1=sol[[2,1,2]]
f[x0]
f[x1]

The plot that follows on the next page confirms that the two corresponding tangent lines (in blue) are indeed parallel to the given line (in red).

y1=f[x0]+f'[x0](x-x0)
y2=f[x1]+f'[x1](x-x1)
Plot[{f[x],y1,y2,3x-2},{x,-1,1},PlotRange->{-5,15},PlotStyle->{Black,Blue,Blue,Red}]

NOTE: One would expect the tangent line at the origin to be horizontal based on a visual inspection of the graph of f, but this demonstrates the pitfall of using a graphing approach.

Exercises

In Exercises 1 through 4, compute derivatives of the given functions.
1.  f(x) =(x^(2 ))(e^((x^3)-4x))			2.  f(x)=(x^a)+(a^x)		
3.  f(x)=ln (x-1)+ln(x+1)	4.  f(x)=(Subscript[log, 10])(((x((((x^3)-3x+1)/((x^2)-2x-3))))^(3/2)))

5.  Find the second and third derivatives of f(x)=(e^x)ln x.

6.  Let f(x)=cos x +ln x.  Plot the graphs of f and f' on the same set of axes.

7.  Find an equation of the line tangent to the graph of f(x)=((ln x)/(x^2)) that is parallel to the x-axis.

8.  Discovery Exercise: Define sinh x=((e^x)-(e^(-x)))/2 and cosh x=((e^x)+(e^(-x)))/2. These functions are called the hyperbolic sine and hyperbolic cosine of x, respectively.

a) Determine the initial eight derivatives of each of these two hyperbolic functions.

b)  Determine general formulas for the nth derivatives of these functions based on the pattern and verify your contentions via mathematical induction.

c) How do the higher-order derivatives of sinh x and cosh x compare with those of the trigonometric functions sin x and cos x?