Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can cos(a + 90 - b)=k.a be solved?

  1. Jun 25, 2011 #1

    quick question, is it possible to solve an equation of the type:

    cos(a + 90 - b) = k.a

    to find a where b and k are known? Do you have to solve this by iteration?

  2. jcsd
  3. Jun 25, 2011 #2
    Hi kennethgilpin! :smile:

    I very much doubt that your equation can be solved analytically. But I'm quite sure you can find a numerical answer. Let's define

    [tex]f:\mathbb{R}\rightarrow\mathbb{R}:x\rightarrow \frac{\cos(x+90-b)}{k}[/tex]

    take [itex]x_0[/itex] arbitrary and keep applying f on it. You'll get a sequence


    Compute the first few terms and see if it converges. If it doesn't, then we'll have to apply more powerful methods...
  4. Jun 26, 2011 #3
    We can group x and 90 and use the angle sum identity of cosine to say cos(x+90-b)=cos(x+90)cos(b)+sin(x+90)sin(b). We can use the same identity to say cos(x+90=cos(x)cos(90)-sin(x)sin(90)=-sin(x) and we can use the angle sum identity of sine to say sin(x+90)=sin(x)cos(90)+sin(90)cos(x)=cos(x). It follows that cos(x+90)cos(b)+sin(x+90)sin(b)=-sin(x)cos(b)+cos(x)sin(b). Therefore, cos(x+90-b)=cos(x)sin(b)-sin(x)cos(b).

    We had to use the same identity twice, so I guess you could call it iterated.
  5. Jun 27, 2011 #4
    Sorry, didn't understand a thing the guys before me said xD sorry, but I'm guessing that it's not possible to find a FINITE answer as it is only one ecuation with three unknown answers.
  6. Jun 27, 2011 #5


    User Avatar
    Homework Helper

    TylerH misunderstood the question, and the word you're looking for isn't finite, it's "expressible in terms of elementary functions". The solution(s) are definitely finite.
  7. Jun 28, 2011 #6
    Thank you for your detailed replies.

    although I was pretty handy at maths, that was 'A' level which was almost 20 years ago, so I don't understand the notation in micromasses answer.

    I'm a physiological modeller, and solved the equation by induction, i.e. by knowing my upper and lower limit for the equation I picked a value halfway, then calculated an answer for both sides of the equation, then picked a value halfway between that and so on. I'm guessing that micromass was sort of suggesting that.

    The problem is that this has to be done about 25 times (*10 iterations) and each iteration has floating point stuff that computers don't like. Having to solve things by induction is the bane of physiological modelling.

  8. Jun 28, 2011 #7


    User Avatar
    Homework Helper

    The numerical method you're applying is quite slow, as you can tell. Applying Newton's method however will be a lot quicker.

    It's defined as follows:

    [tex]a_n=a_{n-1}-\frac{f(a_{n-1})}{f '(a_{n-1})}[/tex]

    And basically, this is how it works:

    Since you need to solve for a (usually denoted as x), you let [tex]y=f(a)=ka-\cos\left(a+90-b\right)[/tex]

    Then find its derivative, [tex]f '(a)=k+\sin\left(a+90-b\right)[/tex]

    And for the first iteration, take a reasonably good guess at what the value of a is (denoted a0), then apply the Newton's method:


    a1 will be a better approximation, then you apply the same formula to find a2 etc.

    EDIT: it's supposed to be f ' (a), LaTeX is screwing with me
  9. Jun 28, 2011 #8
    Ahh, I remember this from school. Presumably it only works if you can find a derivative of the original function.
  10. Jun 28, 2011 #9


    User Avatar
    Homework Helper

    Yep, but unless you have other non-elementary functions that you're also dealing with, it shouldn't be a worry.
  11. Jun 28, 2011 #10


    User Avatar
    Science Advisor
    Gold Member

    One caution about Newton's method is that a bad initial choice can diverge. If you are programming this, it should be easy to find open source code for 'safe newton/raphson', where you bound that a root must be in some interval. Then, the code detects a bad guess and uses another method for one iteration, going back to Newton thereafter. As long as you can find some bounds in which a root must be present, such codes are guaranteed convergent and quite fast.

    In this case, for example, you can guarantee there is s root between [-pi,+pi].

    [EDIT: oh, you are using degrees; make that between [-180,180] ]
    Last edited: Jun 28, 2011
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook