Let f(x)=px+q, where p and q are real numbers. Find p+q if f(f(f(x)))=8x+21. Thank you.

I got this p^3 +p^2q + pq + q = 29
Would you try to solve that? if yes, then how?

f(f(x)] = p(px+q) + q

f[f(f(x)) = p[p(px+q) + q] + q
= p^2(px+q) + pq + q

p^3 x + p^2 q + pq + q = 8 x + 21

= (p^3-8)x + p^2 q + pq + q = 21
this can not be a function of x or it would not be constant 21
so
p^3-8 = 0
p = 2

4 q + 2q + q = 21
q = 3

To find the values of p and q, we can start by simplifying the expression f(f(f(x))) = 8x + 21.

Given that f(x) = px + q, we can rewrite the expression as:

f(f(f(x))) = f(f(px + q)) = f(p(px + q) + q) = f(p(px + q) + q) = 8x + 21

Expanding the innermost f(px + q), we get:

f(px + q) = p(px + q) + q = p^2x + pq + q

So, the expression f(f(f(x))) can be rewritten as:

p(p(p^2x + pq + q) + q) + q = 8x + 21

Simplifying further:

p^3x + p^2q + pq + q^2 + q = 8x + 21

Now, we can compare the coefficients of x and constant terms on both sides.

Coefficients of x: The left side has p^3x and the right side has 8x. Since these should be equal, we have:
p^3 = 8

Constant terms: The left side has p^2q + pq + q^2 + q and the right side has 21. These should also be equal, so we have:
p^2q + pq + q^2 + q = 21

From the equation p^3 = 8, we can take the cube root of both sides to find the value of p:

p = ∛(8)

p = 2

Next, we substitute p = 2 into the equation p^2q + pq + q^2 + q = 21:

(2^2)(q) + (2)(q) + q^2 + q = 21

4q + 2q + q^2 + q = 21

Now, we can simplify this equation:

q^2 + 7q = 21

Rearrange the equation to form a quadratic equation:

q^2 + 7q - 21 = 0

We can solve this quadratic equation using factoring, completing the square, or the quadratic formula.

Factoring the quadratic equation:

(q + 3)(q - 7) = 0

This gives us two possible values for q: q = -3 or q = 7.

So, the solutions for p and q are:

p = 2
q = -3 or q = 7

To find p + q, we substitute these values into the expression:

p + q = 2 + (-3) or p + q = 2 + 7

Therefore, p + q can be either -1 or 9, depending on the value of q.