How to show that right triangle is intersection of two rectangles in Cartesian coordinates? I am trying to do the following.
Given the triangle
$$T:=\left\{(x,y)\mid 0\leq x\leq h,0\leq y\leq k,\frac{x}{h}+\frac{y}{k}\leq1\right\}$$
find two rectangles $R$ and $S$ such that $R\cap S=T$, $\partial R\cap T$ is the two legs of $T$, and $\partial S\cap T$ is the hypotenuse of $T$ union the vertex of $T$. The rectangle $R$ should be of smallest area.
For example, for $h=4$ and $k=3$,

Clearly,
$$R=\left\{(x,y)\mid 0\leq x\leq h,0\leq y\leq k\right\}.$$
I am having trouble coming up with a description of $S$ to show that $R\cap S=T$.
I have that $S$ has side lengths
$$\sqrt{h^2+k^2}\qquad\textrm{and}\qquad\frac{hk}{\sqrt{h^2+k^2}}$$
and corners at
$$(0,k)\qquad(h,0)\qquad\left(\frac{h^3}{h^2+k^2},-\frac{h^2k}{h^2+k^2}\right)\qquad\left(-\frac{k^3}{h^2+k^2},\frac{hk^2}{h^2+k^2}\right).$$
How do I describe $S$ in a way that I can show $R\cap S=T$?

Note that $\frac{x}{h}+\frac{y}{k}=1$ is equivalent to $y=-\frac{k}{h}x+k$.
Define
$$H_1=\left\{(x,y)\mid y\leq-\frac{k}{h}x+k\right\}\\
H_2=\left\{(x,y)\mid y\leq\frac{h}{k}x+k\right\}\\
H_3=\left\{(x,y)\mid y\leq\frac{h}{k}x-\frac{h^2}{k}\right\}\\
H_4=\left\{(x,y)\mid y\leq-\frac{k}{h}x\right\}.$$
Show that $H_1\cap H_2\cap H_3\cap H_4$ is such a rectangle that fits your condition for $S$, and that
$$H_1\cap R=T\\
H_2\cap R=R\\
H_3\cap R=R\\
H_4\cap R=R;$$
thus, $H_1\cap H_2\cap H_3\cap H_4\cap R=T$.
(Note that $\partial H_1\parallel\partial H_4$, $\partial H_2\parallel\partial H_3$, and $\partial H_1\perp\partial H_2$, according to the point-slope form of the equations given for the definitions of $H_1$, $H_2$, $H_3$, and $H_4$.)
