Next we consider the criterion S2

s2=((((k^2)r+q))/(2(1+k)))-((((r^2)+ r q))^(1/2))+r

Lets plot this S2 surface in 3 D for several values of k

plt[kin_]:=Plot3D[s2/.{k->kin},{r,0,1},{q,0,1},AxesLabel->Automatic];
Table[plt[ii],{ii,-0.5,3.0,0.5}]

The maximum seems to happen at r = 0 or r = 1.  Lets look at each case separatly.  For the first

s2/.{r->0}

For the second

s2At1=s2/.{r->1}

Lets take the first and second q derivative and find the optimal point of this function.

D[s2At1,q]
D[s2At1,{q,2}]//Simplify

Note that the second derivative is postive meaning we have found a minimum

Solve[D[s2At1,q]==0,q]
Simplify[s2At1/.{q->2 k +(k^2)},k>-1]

Thus the maximum must happen at an endpoint of the domain either q = 0 or q = 1

s2At1/.{{q->0},{q->1}}//Simplify

It looks like we have three possible values over which we have to take the max

Plot[{(1/(2 (1+k))),((k^2)/(2+2 k)),1-(Sqrt[2])+((1+(k^2))/(2+2 k))},{k,-0.5,3.0},AxesLabel->Automatic]

We can plot just the max if that helps to visualize this

Plot[Max[{(1/(2 (1+k))),((k^2)/(2+2 k)),1-(Sqrt[2])+((1+(k^2))/(2+2 k))}],{k,-0.5,3.0},AxesLabel->Automatic]

The minimum of this is when k = 1.0 and this would be the design parameter to use.

Table[{k,Max[{(1/(2 (1+k))),((k^2)/(2+2 k)),1-(Sqrt[2])+((1+(k^2))/(2+2 k))}]},{k,-0.5,3.0,0.1}]

f[k_]:=Max[{(1/(2 (1+k))),((k^2)/(2+2 k)),1-(Sqrt[2])+((1+(k^2))/(2+2 k))}];
f[1.]