How do you solve for the intersection of a line and a cosine function?

In summary, to solve for the point of intersection of a line and a cosine function, an approximation method like Newton-Raphson may be necessary.
  • #1
Edwin
162
0
Suppose you are given the equation of a line, and a given cosine function that the line intersects. How do you solve algebraically, that is non-graphically, for the point of intersection of the line and the cosine function?

Inquisitively,

Edwin
 
Physics news on Phys.org
  • #2
So you want to solve m*x + b = A*cos(B*x + C) + D, which simplifies to E*x + F = cos(B*x + C).
Since cosine is transcendental, you will have to employ arccosine or the natural logarithm. You can also use the analytic series or Newton-Raphson, etc. to approximate x. Luckily, you need only look at x in the interval [(-1-F)/E,(1-F)/E].
 
Last edited:
  • #3
Can you give me some specific examples on how I might use one of the four methods you mentioned above to solve an equation of the form

cos(f(x)*pi) - cos(pi*x) = mx + b?

Where f(x) is some function of x, pi is the number pi, and mx +b is the equation of the line that intersects the cosine function.

1) How would I use an analytical method to solve this?

2) How would I use the Newton Raphson method to solve this?

3) How would I use a natural logarithm to solve this?

I don't think I could apply an arccosine in this particular case unlike the case first mentioned above.

If you could give me a reference on the internet where I could look up the answers to the questions 1 through 3 above, that would be much appreciated.

Thanks for the help!

Best Regards,

Edwin
 
  • #4
An approximation method like Newton-Raphson seems to be the only manageable way to get a solution for that equation. You can find the method explained http://planetmath.org/encyclopedia/NewtonsMethod.html .
 
Last edited by a moderator:
  • #5
With a neatly drawn graph, you can get an idea of the number of solutions and even the intervals where they lie making search easier. First of all, for something like [itex]\cos x = Ax + B[/itex], a solution exists only if the right hand side lies between -1 and +1. Since the linear function is unbounded, this means solutions can exist only in some interval(s). You are probably interested in solving more complicated systems like [itex]\cos(f(x)) = Ax + B[/itex] but the basic idea remains the same. Depending on the nature of f(x), the slope [itex]\frac{-A}{B}[/itex] and the y-intercept [itex]B[/itex] it may be possible to estimate the number of solutions. A trivial example is something like [itex]y = k[/itex]. For solutions to exist, we must have [itex]|k| \leq 1[/itex].
 
  • #6
I've done it iteratively before like for solving x = cos x.

I start off with a arbitarty number say x=.5. I take the cosine of it. Then I take the cosine of the output, and then the cosine of that output, and then the cosine of that output... You stop when you notice the values stop changing.
 
  • #7
Thankyou! Taking your advice I propose then the following:


Consider the composite number C that is composed of 2 odd prime numbers a and b.

The following are one of two functions that have vertical asymptotes at plus and minus one, plus and minus the composite number C, and plus and minus the the prime numbers of any given composite C composed of two odd prime numbers x=a and x=b, that is C = a*b, where "a" and "b" are odd prime numbers.

f(x) = {1/(cos(k*x/2 + k*C/(2*x)) + cos(k*x) + 2) if (C+1)/2 is odd}

f(x) = {-1/(cos(k*x/2 + k*C/(2*x)) - cos(k*x)-2) if (C+1)/2 is even}

Where k is the constant pi, which is approximately equal to 3.141592654.

Your idea is to graphically determine a range that the solution to the equation exist within. What would be nice is to find a broad range, and then be able to narrow the range quickly.


For the case where (C + 1)/2 is an even integer, the following function might suffice.


f(x,y) = x*y - (-1/(cos(k*x/2 + k*C/(2*x)) - cos(k*x) - 2)),

Where {2<x<C}

There exists a vertical asymptote where this function tends to negative infinity at the prime factors of C (also at plus and minus C and plus and minus 1).

Where y is between 0 and 1.

For y near 0, the function is negative for almost all x between x = 0 and x = C.

For y near 1, the function is only negative on the following intervals:

{a-1<a<a+1}

{b-1<b<b+1}

Where a and b are the prime factors of C!


This means that if we start with y near 0, we can determine a range of values where the function above is negative, our prime factors exist in this range. Then to narrow the range, we increase y in managable increments towards 1, and narrow our range over which the function is negative. The result intervals over which the function is negative quickly narrows to within plus or minus 1 of our prime factors! A similar function can be derived for the case when (C+1)/2 is an odd integer!

One might be able to write up a computer program that can factor large composites C composed of two odd prime numbers, a and b!

Does this seem like it will work? Can you say RSA challenge numbers?

Ah, it's got to be to good to be true.

Inquisitively,

Edwin
 
Last edited:

FAQ: How do you solve for the intersection of a line and a cosine function?

How do you find the point of intersection between a line and a cosine function?

To find the point of intersection between a line and a cosine function, you need to set the equation of the line equal to the equation of the cosine function. Then, you can solve for the variable using algebraic methods such as substitution or elimination. The resulting value will give you the x-coordinate of the point of intersection. To find the y-coordinate, plug the x-value into either the equation of the line or the cosine function.

Can you use a graph to solve for the intersection of a line and a cosine function?

Yes, you can use a graph to solve for the intersection of a line and a cosine function. Graph both the line and the cosine function on the same coordinate plane and look for the point(s) where the two graphs intersect. These points will represent the x and y coordinates of the point(s) of intersection.

How many solutions can you expect to find when solving for the intersection of a line and a cosine function?

You can expect to find up to two solutions when solving for the intersection of a line and a cosine function. This is because a cosine function repeats itself every 360 degrees, so there may be more than one point of intersection between the line and the cosine function. However, there may also be no points of intersection if the line and the cosine function do not intersect at any point.

Is there a specific method or formula for solving for the intersection of a line and a cosine function?

No, there is not a specific method or formula for solving for the intersection of a line and a cosine function. The approach may vary depending on the specific equations given. However, the general method involves setting the equations equal to each other and solving for the variable.

How does the amplitude and period of a cosine function affect the point of intersection with a line?

The amplitude and period of a cosine function can affect the point of intersection with a line. If the amplitude is increased, the graph of the cosine function will be stretched vertically, resulting in a higher point of intersection with the line. If the period is decreased, the graph of the cosine function will be compressed horizontally, resulting in more points of intersection with the line within a given interval.

Similar threads

Back
Top