Solving equation involving an undefined function

I am new to mathematica and this is my first question, so please forgive me if it is something trivial. I am solving a maximisation problem, and my foc is the following:

focsm = g (sg^2 + sm (-2 + 2 fg + 4 fm + 3 sm) + sg (-1 + fg + 3 fm + 4 sm)) + B[1 - fg - fm - sg - sm] - (fm + sm) Derivative[1][B][ 1 - fg - fm - sg - sm]

As you may notice, it involves the function B[.] and its derivative. Now, for me B[.] is a generic function, with first derivative positive and second derivative less or equal than zero. I need to impose the foc equal to zero, and solve for sm (or alternatively fm). I tried with the command Solve, but it doesn't work.

Solve[focsm == 0, sm]

If I give a functional form to B[.] (for example linear), everything works. How can I solve this?

This is because the variable sm occurs in the function B, therefore Mathematica must know about the values the function takes. A simpler version of this can be seen in
Solve[g+f'[x]==0,g]

• There is no general solution unfortunately because, in the simplest case, solving $f(x) + g(x) = 0$ depends entirely on $f$ and $g$. Apr 18, 2020 at 22:15