Calculating maximum power transfer for given circuit
Since the unknown resistance, \$R\$, and the fixed voltage supply are in series, they can be swapped without loss for analysis. The resulting schematic is as simple as the following case:



simulate this circuit &ndash; Schematic created using CircuitLab
You only have one node to solve for, making this almost trivial:
$$\frac{V}{R_1=5\:\Omega}+\frac{V}{R}=100\:\text{mS}\cdot\left(V-{-5}\:\text{V}\right)+\frac{-5\:\text{V}}{R}$$
Solve the above equation for \$V\$ and then apply it to the power equation: \$P_R=\frac{\left(V\,-\,{-5}\:\text{V}\right)^2}{R}\$. Take the differential with respect to \$R\$ and then set that equal to zero and solve. You will find the solution to be \$R=10\:\Omega\$.
In sympy:
v=Symbol('v')
r=Symbol('r')
solve(Eq(derivative(simplify((solve(Eq(v/5+v/r,.1*(v+5)-5/r),v)[0]+5)**2/r),r),0),r)[0]

10.0000000000000