# Differential equation satisfying $f(\theta)=\frac{d}{d\theta}\int_0^\theta\frac{dx}{1-\cos\theta\cos x}$

Find the differential equation satisfying $$f(\theta)=\frac{d}{d\theta}\int_0^\theta\frac{dx}{1-\cos\theta\cos x}$$

It is solved in my reference (also in this video) as: $$f(\theta)=\frac{d}{d\theta}\int_0^\theta\frac{dx}{1-\cos\theta\cos x}=\frac{1}{1-\cos^2\theta}=\csc^2\theta\\ f'(\theta)=-2\csc^2\theta\cot\theta\\ f'(\theta)+2f(\theta)\cot\theta=0$$ As per my knowledge the Leibniz rule is $$\frac{d}{d\theta}\int_{a(\theta)}^{b(\theta)}g(\theta,x)dx=g(\theta,b(\theta))\frac{d}{d\theta}b(\theta)-g(\theta,a(\theta))\frac{d}{d\theta}a(\theta)$$ iff $$g(x,\theta)=g(x)$$

So isn't it wrong to approach the problem as in my reference ?

• What you've written doesn't make sense. Firstly, use a letter other than $f$ to denote the integrand to avoid confusion with the original function. Secondly, it depends on two variables and so the right hand side isn't defined. Jan 22, 2020 at 1:51
• @OliverJones I don't think there is anything wrong with having two variable in the integration, thats where Leibniz rule come into picture right ?. But, here I am having trouble understanding if something is wrong in the actual question. Jan 22, 2020 at 1:54
• That's not what I'm saying. Jan 22, 2020 at 1:55
• The link doesn't work. $f(x,\theta)$ is a function of two variables; $f(\theta)$ is a function of one variable. What you wrote is nonsense. Jan 22, 2020 at 1:57
• See the Leibniz integral rule$$\frac{d}{d\theta} \left (\int_{a(\theta)}^{b(\theta)}f(\theta,x)\,dx \right) = f\big(\theta,b(\theta)\big)\cdot \frac{d}{d\theta} b(\theta) - f\big(\theta,a(\theta)\big)\cdot \frac{d}{d\theta} a(\theta) + \int_{a(\theta)}^{b(\theta)}\frac{\partial}{\partial \theta} f(\theta,x) \,dx$$ Jan 22, 2020 at 2:20

The Leibniz integral rule states $$\frac{d}{d\theta} \left (\int_{a(\theta)}^{b(\theta)}g(\theta,x)\,dx \right) = g\big(\theta,b(\theta)\big)\cdot \frac{d}{d\theta} b(\theta) - g\big(\theta,a(\theta)\big)\cdot \frac{d}{d\theta} a(\theta) \color{blue}{+ \int_{a(\theta)}^{b(\theta)}\frac{\partial}{\partial \theta} g(\theta,x) \,dx}$$

where your problem is defined as

$$f(\theta)=\frac{d}{d\theta}\left (\int_0^\theta\frac{1}{1-\cos\theta\cos x}\,dx\right)$$

therefore

$$g(\theta,x)=\frac{1}{1-\cos\theta\cos x},\quad a(\theta)=\theta,\quad b(\theta)=0$$

and with the tangent half-angle substitution of $$t=\tan \frac{x}{2}$$ shown inside this question we have that

\begin{align}f(\theta)&=\frac{d}{d\theta}\left (\int_0^\theta\frac{1}{1-\cos\theta\cos x}\,dx\right) \\&=0-\frac{1}{1-\cos^2{\theta}}-\int_0^\theta\frac{\sin\theta\cos x}{(\cos\theta\cos x- 1)^2}\,dx\\&= -\csc^2\theta+\csc^2\theta -\frac{\pi}{2}\cot\theta\csc\theta\\&= -\frac{\pi}{2}\cot\theta\csc\theta \end{align}

so the derivation made in the video is incorrect as it is missing the third term in the Leibniz rule.

• The integral can be done with the Weierstrass substitution $\displaystyle{t=\tan \frac{x}{2}}$. However, using Leibniz's rule is inefficient since the original integral can be done directly. Jan 22, 2020 at 7:54

The answer in the video is incorrect. If you do the integral directly and then differentiate, you should get

$$f(\theta )=-\frac{\pi}{2}\csc \theta \cot \theta.$$