Given that \(y = 7 - px - x^2 = 16 - (q + x)^2\) for all values of \(x\), where \(p\) and \(q\) are both positive,

- calculate the values of \(p\) and \(q\),

By expanding the equation \[ 7 - px - x^2 = 16 - (q + x)^2, \] we arrive at the equation \[ 7 - px - x^2 = 16 - q^2 - 2qx - x^2. \] Since this is true for all \(x\), we can equate coefficients, giving \(7 = 16 - q^2\) and \(-p = -2q\).

Thus \(q^2=9\). Since the question tells us that \(p\) and \(q\) are both positive, we must have \(q=3\), so \(p=6\).

Thus \(y=7-6x-x^2=16-(3+x)^2\).

- state the maximum value of \(y\) and the value of \(x\) at which it occurs,

As \(y = 16 - (3 + x)^2\), we see that the maximum value of \(y\) is \(16\), and this occurs when \(x = -3\).

(This is because \((3 + x)^2 \ge 0\) no matter what the value of \(x\), so \(y\) is maximised when \((3 + x)^2=0\).)

- find the range of values of \(x\) for which \(y\) is positive.

Again, the second representation is useful here: \(y\) is positive when \(16 - (3 + x)^2 > 0\), that is, when \((3 + x)^2 < 16\). This gives \(-4 < 3 + x < 4\), so \(-7<x<1\).

Alternatively, we can use the first representation, \(y=7-6x-x^2=-(x^2+6x-7)=-(x-1)(x+7)\). This is zero when \(x=1\) or \(x=-7\). As this is a “vertex-up” parabola (since the coefficient of \(x^2\) is negative), \(y>0\) when \(-7<x<1\).