Implicit Differentiation & Profit Function
I will only set up the first part of your question. See if you can move on from there.

If you try and set revenue as $p \cdot x$ immediately, you will get

$$p \cdot x = p \cdot (\gamma ap + b + R(y))$$

which as you note means $x$ will not be in this term. Profit could technically still be expressed in terms of $x, y$ in this case, but...

$$\pi(x, y) = p \cdot (\gamma ap + b + R(y)) - (cx + y + d)$$

is awkward since $x$ can be expressed in terms of $p$ and vice versa, so why would we have both in our equation?

So instead, solve for the inverse demand function:

$$x = \gamma ap + b + R(y) \implies \boxed{p = \frac{x - b - R(y)}{\gamma a}}$$

So you can solve for $p \cdot x$, but instead of substituting for $x$, you substitute for $p$. Once you solve for your first order conditions, you should be able to solve for $y$ as a function of variables including $b$.

Hope this helps.