I am looking at the following problem.
We have the area of a triangle given by $A(a,b,\theta)=\frac{1}{2}ab\sin{\theta}$, where $a$ is the base and $b\sin{\theta}$ is the height. And the constraint $a=b\cos\theta$. The goal is to find $$\left(\frac{\partial A}{\partial \theta}\right)_{a}$$
That is, partial $A$ with respect to $\theta$ holding $a$ constant.
Now, I am practicing constrained differentials and the method of total differentials is one way given to solve this problem.
However, I am trying to solve the problem using the chain rule and my answer does not match the answer given via total differentials. The answer given is $$\frac{1}{2}ab\sec{\theta}$$
Here is my attempt using the chain rule:
We want to figure out the RHS of $$\left(\frac{\partial A}{\partial \theta}\right)_{a}=\left(\frac{\partial A}{\partial \theta}\right) + \left(\frac{\partial A}{\partial b}\right)\left(\frac{\partial b}{\partial \theta}\right)_{a}$$
We have $$\begin{align*} \frac{\partial A}{\partial \theta} &= \frac{1}{2}ab\cos\theta\\ \frac{\partial A}{\partial b} &= \frac{1}{2}a\sin\theta\\ \left(\frac{\partial b}{\partial \theta}\right)_{a} &= a\tan{\theta}\sec{\theta}\\ \end{align*} $$
Thus,
$$\left(\frac{\partial A}{\partial \theta}\right)_{a}=\frac{1}{2}ab\cos\theta+\frac{1}{2}a\sin\theta\cdot a\tan{\theta}\sec{\theta}$$
Now, I have tried simplifying the above expression on the RHS but the best I get is:
$$\frac{1}{2}a(a\tan^2\theta+b\cos\theta).$$
Prior to simplifying though one can see that the answers won't match due to the $a^2$ term in the the answer using the chain rule.
If you use the constraint $a=b\cos\theta$, you can rewrite your expression:
$$\frac{1}{2}a(a\tan^2\theta+b\cos\theta) = \frac{1}{2}a^2(\tan^2\theta+1) = \frac{1}{2}a^2\sec^2\theta = \frac{1}{2}ab\sec\theta \; .$$