Let
p(x,y) = x + y if x >= 0 and y >= 0
p(x,y) = 3x + y if x < 0 and y < 0
p(x,y) = x - 2y otherwise
What is p(p(1,-1),p(-5,-2))?
p(1, -1) = (1) - 2(-1) = 1 + 2 = 3
p(-5, -2) = 3(-5) + (-2) = -15 - 2 = -17
So
p ( p (1,-1) , p(-5,-2) ) = p ( 3 , -17) =
(2) - 2(-17) =
36