1. The problem statement, all variables and given/known data
This is straight from the book.

A small block of mass m rests on the sloping side of a triangular block of mass M which itself rests on a horizontal table as shown in Fig. 4-50. Assuming all surfaces are frictionless, determine the force F that must be applied to M so that m remains in a fixed position relative to M (that is, m doesn't move on the incline).

(I forgot to draw the surface the triangular block is on and sorry for the big picture!)

The answer is:

Spoiler

(m + M) [tex]\ast[/tex] g[tex]\ast[/tex] tan([tex]\phi[/tex])

2. Relevant equations
Force along the x-axis: m [tex]\ast[/tex] g [tex]\ast[/tex] sin([tex]\phi[/tex])
Force along the y-axis: m [tex]\ast[/tex] g [tex]\ast[/tex] cos([tex]\phi[/tex])

3. The attempt at a solution
I know that there must be an equal and opposite force along the incline but I have no clue how to approach this problem. 1. The problem statement, all variables and given/known data