# cosine function

• Apr 22nd 2007, 05:57 AM
Mr_Green
cosine function
Find an equation for the cosine function that has one maximum at the point (4,6) and its next minimum at the point (5.5,1).
• Apr 22nd 2007, 06:17 AM
topsquark
Quote:

Originally Posted by Mr_Green
Find an equation for the cosine function that has one maximum at the point (4,6) and its next minimum at the point (5.5,1).

y(x) = A*cos(k*x + (phi))

y'(x) = -A*k*sin(k*x + (phi))

y''(x) = -A*k^2*cos(k*x + (phi)) = -k^2*y(x)

So we know that (4, 6) is a maximum point. That is, we know that
y'(4) = -A*k*sin(4k + (phi)) = 0
y''(4) = -k^2*y(4) = -A*k^2*cos(4k + (phi)) < 0 (So y(4) > 0)

This means:
sin(4k + (phi)) = 0

4k + (phi) = n*(pi) <-- n is some integer.

We know that (11/2, 1) is a minimum. That is, we know that
y'(11/2) = -A*k*sin(11k/2 + (phi)) = 0
y''(11/2) = -k^2*y(11/2) = -A*k^2*cos(11k/2 + (phi)) > 0 (So y(11/2) < 0)

Thus
sin(11k/2 + (phi)) = 0

11k/2 + (phi) = m*(pi) <-- m is some integer.

So we have two equations in k and (phi):
4k + (phi) = n*(pi)
11k/2 + (phi) = m*(pi)

The solution is:
k = 2(m - n)(pi)/3
(phi) = (11n - 8m)(pi)/3

So
y(x) = A*cos([2(m - n)/3](pi)*x + [(11n - 8m)/3](pi))
Where
y(4) > 0 and y(11/2) < 0

There are many many possibilities for this. Simply by playing around with m and n I find that m = 2 and n = 1, with A = -1 gives a good function. That is, one solution is
y(x) = -cos((2(pi)/3)*x - (5(pi)/3))

-Dan
• Apr 22nd 2007, 08:09 AM
Mr_Green
if the minimum is (5.5,1) then it is not possible for the graph to go below the x axis. the equation that you derived does not work.
• Apr 22nd 2007, 08:31 AM
Jhevon
Quote:

Originally Posted by Mr_Green
if the minimum is (5.5,1) then it is not possible for the graph to go below the x axis. the equation that you derived does not work.

try topsquark's method using y(x) = A*cos(k*x + (phi)) + C as the general form of the cosine function. finding that vertical shift C should solve your problems

or just alter topsquark's formula. say his minimum was at (5.5, -1) then just add 2 to his formula. that would cause a vertical shift of 2 units up, making the min point (5.5,1), of course that depends on whether or not his max point would fall in the right place
• Apr 22nd 2007, 06:23 PM
topsquark
Quote:

Originally Posted by Mr_Green
if the minimum is (5.5,1) then it is not possible for the graph to go below the x axis. the equation that you derived does not work.

:o (Ahem.) I knew that. Really. :o

I don't have time to redo this tonight. I'll try to get to it tomorrow morning.

-Dan
• Apr 23rd 2007, 05:03 AM
topsquark
Okay, let's do this again. Most of my previous solution still holds, it just doesn't finish the job.
Quote:

y(x) = A*cos(k*x + (phi))

y'(x) = -A*k*sin(k*x + (phi))

y''(x) = -A*k^2*cos(k*x + (phi)) = -k^2*y(x)

So we know that (4, 6) is a maximum point. That is, we know that
y'(4) = -A*k*sin(4k + (phi)) = 0
y''(4) = -k^2*y(4) = -A*k^2*cos(4k + (phi)) < 0 (So y(4) > 0)

This means:
sin(4k + (phi)) = 0

4k + (phi) = n*(pi) <-- n is some integer.

We know that (11/2, 1) is a minimum. That is, we know that
y'(11/2) = -A*k*sin(11k/2 + (phi)) = 0
y''(11/2) = -k^2*y(11/2) = -A*k^2*cos(11k/2 + (phi)) > 0 (So y(11/2) < 0)

Thus
sin(11k/2 + (phi)) = 0

11k/2 + (phi) = m*(pi) <-- m is some integer.

So we have two equations in k and (phi):
4k + (phi) = n*(pi)
11k/2 + (phi) = m*(pi)

The solution is:
k = 2(m - n)(pi)/3
(phi) = (11n - 8m)(pi)/3

So
y(x) = A*cos([2(m - n)/3](pi)*x + [(11n - 8m)/3](pi))
Where
y(4) > 0 and y(11/2) < 0
The m = 2, n = 1 part still works because it gives the location of the x values where we have the max and mins, though in reality x = 4 is a minimum point and x = 11/2 is a maximum. (That's why I had a negative A in my first solution.)

We need to modify my solution a bit so that we have
y(x) = A*cos(k*x + (phi)) + C
as Jhevon suggested.

Specifically, I'm going to work with:
y(x) = A*cos([2(m - n)/3](pi)*x + [(11n - 8m)/3](pi))
+ C

Now, the cosine function varies between -1 and 1. We need it to vary between 1 and 6. To do this we need to adjust C such that it is right in the middle of the range [1, 6], that is we need C to be the average of 1 and 6:
C = (1/2)*(1 + 6) = 7/2

Now we need to "stretch" the cosine function so that it will go below the line y = 7/2 down to 1 and above the line y = 7/2 up to 6. Thus we need |A| to be:
|A| = (7/2) - 1 = 6 - (7/2) = 5/2

As I said before I need A to be negative given my choice of m and n, so I get:
y(x) = -(5/2)*cos([2(m - n)/3](pi)*x + [(11n - 8m)/3](pi)) + (7/2)

-Dan