Here we are interested in there trade-off between the size and number of offspring. We want to know the size of offspring that maximizes individual fitness.  This is the classic Smith & Fretwell model of the size-number compromise.  I used different variable names, but the set up is the same.
Source.  Curt Lively, Indiana University.

DEFINING THE VARIABLES...
q = fraction of resources allocated to each offspring.
qmin = the fraction of resources required to produce an offspring that has a survival probability greater than zero.        
x = exponent that controls the shape of expected offspring survival as function of q.						
No = number of offspring (No = 1/q)
Wo = survival prob of each offspring.

q=.
qmin=.
qstar=.
x=.
No=.
Wo=.

FIRST WE DEFINE THE Number of OFFSRPING, No

(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN." )

No = 1/q

NEXT WE DEFINE THE survival probability OF OFFSPRING, Wo

(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN." )

Wo = 1 - (qmin/q)^x

THE FITNESS OF THE PARENT IS THE SIZE (QUALITY) OF OFFSPRING
TIMES THE NUMBER OF OFFSPRING.  HENCE WE GET,

(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN." )

Wp = No*Wo

WE WANT TO KNOW WHERE PARENTAL FITNESS IS AT A LOCAL MAXIMUM.  SO WE TAKE THE FIRST PARTIAL DERIVATIVE OF PARENTAL FITNESS WITH RESPECT TO ALLOCATION TO OFFSPRING,
AND SET IT EQUAL TO ZERO.  FIRST WE TAKE THE DERIVATIVE...

(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN." )

Firstder = D[Wp, q]

(Put the cursor anywhere in the bracket below and press "SHIFT-RETURN." )

FullSimplify[Firstder]

Create a temporary variable equal to the numerator above: tempvar

tempvar=-1+((((qmin/q)))^x) (1+x)

Solve for when tempvar (and firstder) are = 0.

Solve[tempvar==0, q]

Result: qstar =  qmin ((((1/(1+x))))^(-1/x))=qmin(((1+x))^(1/x))
Now we calculate the second derivative.

Secondder=D[Firstder, q]

Now we let q be at the candidate ESS (qstar) and recalculate the second derivative.

qstar=qmin(((1+x))^(1/x));
q=qstar;
FullSimplify[Secondder]

It is not easy to see, but the second derivative is negative when evaluated at qstar.
Let’s plug in some numbers and graph the puppy.
First calculate qstar, the candidate for the ESS, for specific values of x and qmin.

x=0.75;
qmin=0.09;
qstar

So the candidate ESS is at about q = 0.2). 
Now solve for the second derivative.  It should be negative at the candidate ESS if the candidate is in fact Evol. Stable.

FullSimplify[Secondder]

Okay.  the second derivative is negative.  We have an ESS.  
Now let’s plot the puppy.
First let’s see if we have diminishing returns for offspring survival against allocation, q, to each offspring

Plot [{Wo}, {q, 0.06, 0.5}, AxesLabel->{"q", "Wo"}]

Yes, diminishing returns, as expected.
Now let’s plot the first derivative as a function of q.  The slope should be negative when evaluated at qstar=0.19.

Plot [{Firstder}, {q, 0.06, 0.5}, AxesLabel->{"q", "Firstder"}]

Yes, the slope of the first derivative is negative at qstar.  Note qstar is at the point where the first derivative=0.

Finally, let’s plot parental fitness.  There should be a local maximum at qstar

Plot [Wp, {q, 0.06, 0.5}, AxesLabel->{"q", "Wp"}]

Yes.  There is a local max at qstar=0.19.  
Take home message: the maternal parent should allocate about 20% of their resources to each offspring, giving five offspring total.