document.write( "Question 347468:  The triangle inequality states: PQ + QR > PR
\n" );
document.write( "Prove that the equality holds if and only if the point Q lies on the line segment PR when we use the usual Euclidean distance formula. \n" );
document.write( "
Algebra.Com's Answer #248658 by nyc_function(2741)    You can put this solution on YOUR website! Without loss of generality, we can place P at (0,0), R at (a,0), and Q at (x,y) \n" ); document.write( "with a>0 \n" ); document.write( "then the distances are \n" ); document.write( "PQ: sqrt( x^2 + y^2 ) \n" ); document.write( "QR: sqrt( (x-a)^2 + y^2 ) \n" ); document.write( "PR: a \n" ); document.write( "thus we want to know when \n" ); document.write( "PQ + QR = PR or \n" ); document.write( "sqrt( x^2 + y^2 ) + sqrt( (x-a)^2 + y^2 ) = a squaring both sides we get \n" ); document.write( "x^2 + y^2 + 2*sqrt[ (x^2+y^2) * ( (x-a)^2 + y^2) ] + (x-a)^2 + y^2 = a^2 \n" ); document.write( "2*sqrt[ (x^2+y^2) * ( (x-a)^2 + y^2 ) ] = 2ax - 2x^2 - 2y^2 \n" ); document.write( "(x^2 + y^2) * ( (x-a)^2 + y^2 ) = (ax - x^2 - y^2) ^2 \n" ); document.write( "(x^2+y^2)^2 - 2ax(x^2+y^2) + a^2(x^2+y^2) = a^2x^2 - 2ax(x^2+y^2) + (x^2+y^2) \n" ); document.write( "a^2(x^2+y^2) = a^2x^2 since a>0 we can divide it out \n" ); document.write( "x^2+y^2 = x^2 \n" ); document.write( "y^2 = 0 \n" ); document.write( "y=0 \n" ); document.write( "now plugging this into original equation we get \n" ); document.write( "|x| + |x-a| = a \n" ); document.write( "now if x<0 then we get \n" ); document.write( "-x + a -x = a \n" ); document.write( "-2x = 0 \n" ); document.write( "x=0 which contradicts x<0 thus x>=0 \n" ); document.write( "if x>a then we get \n" ); document.write( "x + x -a = a \n" ); document.write( "2x = 2a \n" ); document.write( "x=a which contradicts x>a \n" ); document.write( "thus 0<=x<=a \n" ); document.write( "thus point for PQ+QR=PR to be true, Q must be on the line segment PR \n" ); document.write( " \n" ); document.write( "  |