Maximum area of a rectangle inscribed in the cos(x) function I have to find the maximum area of a rectangle inscribed in the cos(x) function with $0 < x < \pi /2$ (as in the picture below). 

The area, which I will call "A", is defined as 
$$ A = 2 x \cos(x)$$
I started by differentiating the area in terms of x:
$\frac{dA}{dx} = 2\cos(x) + 2x (-\sin(x))$
$\frac{dA}{dx} = 2\cos(x)  -2x\sin(x)$
$\frac{dA}{dx} = 2[\cos(x)  -x\sin(x)]$
Now I look for the critical points
$0 = 2[\cos(x)  -x\sin(x)]$
$0 = \cos(x)  -x\sin(x)$
$x\sin(x) = \cos(x)$
Here sin(x) is not 0 because the domain is restricted to $(0; \pi / 2)$ so I assume I can divide both sides by sin(x) (if this reasoning is wrong please correct me).
$x = \frac{\cos(x)}{\sin(x)}$
$x = \cot(x)$
So this critical point that I'm looking for should be a fixed point of the cotangent on the interval $(0; \pi / 2)$. I made a graph and it seems to match my thinking:



*

*The red line is $x = \pi /2$

*The cyan line is $y = x$

*The black curve is the original area function $A = 2x \cos(x)$

*The orange curve is $\frac{dA}{dx}$

*The purple curve is $\cot(x)$


So it looks like the x value where the cotangent intersects the $y = x$ line is also where the area function peaks and where the derivative is 0. And here is where I'm stuck. How do I find that fixed point of $\cot(x)$? Or maybe I'm making a mistake and there is a simpler way to solve this problem without involving the cotangent, if that's the case I would like to know .
 A: Equations like $x= \cos x$ or $x=\cot x$ generally don't have algebraic solutions. As such, we would first want to note that such an $x$ exists (e.g., by the Intermediate Value Theorem) and then use some numerical approximations (e.g., Newton's Method on $f(x) = \cot(x) -x$ to find a root). Such a numerical method yields $x \approx 0.860334$. 
A: The equation $cot(x)=x$ is transcendental. It can not be solved without using other transcendental functions.
To find an approximate answer to the equation, I would recommend using fixed point iteration. 
A: Your well graphed depiction already enables reading off required solution with  accuracy. I located exact point on your graph. It cannot be solved by  pure arithmetic or algebraic/trigonometric equation, a combination that is "impure" ( called transcendental ) can be solved numerically by Newton-Raphson iteration method among others to more number of digits. 
A: As already said, only nomerical method would allow to find the exact solution.
However, we can approximate the function $x-\cot(x)$ using Padé approximants. Is order to stay with low degrees we could consider $$f(x)=x-\cot(x)=\frac{a_0+a_1 x^2}{x(1+\sum_{i=1}^n a_ix^{2i})}$$ which takes into account the fact that $f(-x)=-f(x)$.
So, by the end, the positive solution will just be the positive root of $a_0+a_1 x^2=0$. For small values of $n$, the solutions are
$$\left(
\begin{array}{cc}
 n & x^2 & x\\
 0 & \frac{3}{4} &0.866025\\
 1 & \frac{20}{27}& 0.860663\\
 2 & \frac{567}{766}&0.860354 \\
 3 & \frac{3447}{4657}&0.860335 \\
 4 & \frac{256135}{346047}&0.860334
\end{array}
\right)$$
Just for your curiosity plot functions $$f(x)=x-\cot(x)\qquad \text{and}\qquad g(x)=\frac{\frac{27 x^2}{20}-1}{x-\frac{x^3}{60}}$$ for $0\leq x \leq \frac \pi 2$; you will see how close they are.
