Remember that cos²Φ + sin²Φ ≡ 1
Therefore
r² = r²(cos²Φ + sin²Φ ) = r²cos²Φ + r²sin²Φ = (r cosΦ )² + (r sinΦ )² = 3² + 4²
so r = √(3² + 4²)
Or another way to look at it:
r cos Φ = adjacent side of a triangle with hypotenuse r
r sin Φ = opposite side of a triangle with hypotenuse r
adjacent is 3, opposite is 4, therefore r = hypotenuse = √(3²+4²) = 5