Biggest rectangle inscribed in a triangle Bonjour! Being the low level matematician that I am (unfortunately) I can't seem I find a way to solve this practical problem. 
I have a triangle, which sides are 40 for the base and 27 for the two sides. 
I want to find out which is the biggest rectangle that I could fit in that triangle (in any way, could be rotated, etc.). 
I've approached it as an optimization problem but I can't seem to find a solution. Cheers!
 A: I assume in this case you mean by inscribed, that all four vertices need not be on the triangle.  We can consider this in several cases.  Let the triangle be $PQGR$ and the quadrilateral be $ABCD$:
Case 1: All the vertices $A, B, C, D$ are in fact  on $\triangle PQR$ - note that we always have this case in any triangle (for an obtuse triangle you can take the base to be the longest side).  Necessarily this means two sides of the rectangle are parallel to one side, say $QR$.  Let $h$ be the height of $\triangle PQR$ with $b = \lvert QR \rvert$ as base.  Also WLOG let $AB$ lie on $QR$ and let $P$ be opposite $DC$.  Then we have $$\triangle PQR \sim \triangle PDC \implies k =  \dfrac{\lvert DC \rvert}{\lvert QR \rvert} = \dfrac{\text{height of } \triangle PDC}{\text{height of } \triangle PQR}$$ 
Hence we have $\lvert DC \rvert = kb$ as the base of the rectangle and the height of $\triangle PDC$ is $kh$, so we have the area of the rectangle as $kb(h-kh) = bh \cdot k(1-k)$.  This clearly gets maximised when we choose $k=\frac12$, and we can thus get half the area of the triangle as the area of the maximal such rectangle.  
Case 2: Exactly one vertex, say $D$ is not on $\triangle PQR$.  Here, you can chop off parts of the triangle to get Case $1$ for a smaller triangle. There are many orientations, but in each case this is possible.  In one particular case, you may need to draw a line parallel to $CD$ or $DA$ from one of the triangle vertices, which cuts the rectangle and triangle into two parts.  One part has case $1$ applicable, and for the other part, we can chop off part of the triangle to again invoke case $1$.  Hence necessarily this case generates only rectangles of area strictly less than $\frac12$ of the area of $\triangle PQR$.
Other cases - only two vertices on $\triangle PQR$ etc. are similar, we can chop off parts of the triangle to reduce them to Case $1$.  Hence in all such cases we can never achieve $\frac12$ the area of $\triangle PQR$, hence Case $1$ is the optimal one.
