rectangle inscribed in a triangle

domain question> http://i207.photobucket.com/albums/b...EvErSe_/16.jpg

triangle question>

http://i207.photobucket.com/albums/b..._/untitled.jpg

NOTE : PLEASE IGNORE THE NUMBER 1 MARKED ON TOP OF THE RECTANGLE IN THE TRIANGLE QUESTION (I DREW THAT).

i have the domain one but i'm not sure if I did it right, i got domain is (negative infinity, positive infinity) and my graph is going up with a top and then curves down like an upside down u and then for the secod question part a i got P(x,1/2) and part b i cant figure out the lengths of the rectangle ? if anyone could help it would be much appreciated thank you in advance. im just really worried ><