# Find max of this equation

1. May 21, 2013

### yungman

Find the maximum $\theta$ of
$$\left[\frac{\cos\left(\frac{kl}{2}\cos\theta\right)-\cos\left(\frac {kl}{2}\right)}{\sin\theta}\right]^2$$
So I need to find the maximum of
$$F(\theta)=\frac{\cos\left(\frac{kl}{2}\cos\theta\right)-\cos\left(\frac {kl}{2}\right)}{\sin\theta}$$
First I differentiate respect to $\theta$ and equate to 0
$$dF(\theta)=\frac{(\sin\theta)\left(-\sin\left(\frac{kl}{2}\right)\cos\theta\right)\left(-\frac{kl}{2}\sin\theta\right)-\left[\cos\left(\frac{kl}{2}\cos\theta\right)-\cos\left(\frac{kl}{2}\right)\right](-\cos\theta)}{\sin^2\theta}=0$$
So
$$\Rightarrow\;(\sin\theta)\left(-\sin\left(\frac{kl}{2}\right)\cos\theta\right)\left(-\frac{kl}{2}\sin\theta\right)-\left[\cos\left(\frac{kl}{2}\cos\theta\right)-\cos\left(\frac{kl}{2}\right)\right](-\cos\theta)=0$$

This is no easier to solve compare to the original equation before differentiation. I tried letting $u=\frac{kl}{2}\cos\theta\Rightarrow\;du=-\frac{kl}{2}\sin\theta d\theta$. But still it is going nowhere. Please help.

2. May 21, 2013

### Dick

You won't be able to solve that exactly. Is this a diffraction problem or something? I believe you are supposed to use an approximation like (kl/2)<<1. Then expand the outside cos functions in the numerator into a power series and only keep the lowest nonvanishing term in kl/2.

3. May 21, 2013

### yungman

Thanks for the time, kl/2 can be over 10 as $k=\frac {2\pi}{\lambda}$ and l can be up to 3$\lambda$!!!.

So there is no easy way to solve this?

Thanks

4. May 21, 2013

### Dick

Not sure I'm quite following you there. Can you show your complete solution? No, there's no easy way to get an EXACT solution. There's an easy way to get an approximate solution if you take kl/2<<1.

5. May 21, 2013

### yungman

What I meant is I have to work with $\frac{kl}{2}$≥10 or so. So the approx of kl/2<<1 is not going to work for me.

Do I use power series representation to solve it? Still the $\cos(\frac{kl}{2}\cos\theta)$ is going to be tricky.

6. May 21, 2013

### Dick

No, power series only useful if you expand in a small parameter. If kl/2 is large, I'd suggest just plotting the function for kl/2=10 and larger numbers and looking at the graph to try and get another idea. That's what I'm doing. You do only have to look at the plot in the range [0,2pi] or even [0,pi/2]. It is still periodic.

7. May 22, 2013

### yungman

Thanks.

8. May 22, 2013

### Ray Vickson

For a = kl/2, the function f(θ) on [0,2π] has 14 local optima in (0,2π) (7 local maxima and 7 local minima). In other words, there would be 14 separate solutions to f'(θ) = 0. It appears from the graph that there are two global maxima (at θ = 0.8647431283 and θ = 2.276849525), both giving f = 2.389314458 .

9. May 22, 2013

### Dick

So that's for a=10, yes? Now Yungman should try to figure out a way to guess an approximation of where that first global max is. Try plotting the numerator and the denominator separately and thinking about why they look like they do. Doing that I can make a guess that the first global max should come at about the first value of θ>0 where cos(10*cosθ)=1. That you can solve for. It's about 0.891. Which is not a bad estimate. If kl/2 is very large you might be able to make even closer estimates.

10. May 22, 2013

### yungman

Sounds like writing an excel program and plot a point every 3 deg is in order!!! Is there any free online program I can use. I am not an expert in math, I don't keep up with what's available online.

Many thank to everyone that put in the time to help me.

Alan

11. May 22, 2013

### haruspex

In case it matters, that's wrong. There's a misplaced right parenthesis. Should be
$$dF(\theta)=\frac{(\sin\theta)\left(-\sin\left(\frac{kl}{2}\cos\theta\right)\right)\left(-\frac{kl}{2}\sin\theta\right)-\left[\cos\left(\frac{kl}{2}\cos\theta\right)-\cos\left(\frac{kl}{2}\right)\right](-\cos\theta)}{\sin^2\theta}=0$$

12. May 22, 2013

### Dick

Nah, doesn't really matter, I think it's just a typo. That whole route is a dead end anyway.

Last edited: May 22, 2013