I have an equation and I want to take its derivative with respect to two variables. However, it contains some parameters which need to solve them together to find them (Pn, omega, gamma). These parameters are implicit in each other. I defined first some parameters and I want now to take the partial derivative with respect to rho, x1, x2.
alpha = sqrt (4*pi*beta*e^2/eps0)
eta3 = x1*rho*sigma1^3 + x2*rho*sigma2^3
delta = 1 - pi*eta3/6
rho1 = x1*rho
rho2 = x2*rho
gamma = alpha/
2*((rho1*(z1 -
pi/(2*delta)*sigma1^2*Pn/(1 + gamma*sigma1))) + (rho2*(z2 -
pi/(2*delta)*sigma2^2*Pn/(1 + gamma*sigma2))))^0.5
omega = 1 +
pi/(2*delta)*(rho1*sigma1^3*z1/(1 + gamma*sigma1) +
rho2*sigma2^3*z2/(1 + gamma*sigma2))
Pn = 1/omega*(rh1*sigma1*z1/(1 + gamma*sigma1) +
rh2*sigma2*z2/(1 + gamma*sigma2))
f[_rho, _x1, _x2] = -e^2/
eps0*(gamma*((rho1*
z1^2/(1 + gamma*sigma1) + (rho2*z2^2/(1 + gamma*sigma2)) +
pi/(2*delta)*omega*Pn^2)) + gamma^3/(3*pi)
I attached two pictures to illustrate the equations: - I want to take the derivative of the equation 28 with respect to xion, where rho_ion = xion*rho. Keeping in mid the following: The system of equations 29 need to be solved first to get the derivative since they depend on xion and on each other. Also, they are implicit.
Could you please help me? I'm new to Mathematica so I will appreciate any help. Thanks in advance.


gamma=and so Mathematica makes note that gamma is being defined and it starts evaluating the right hand side. During that it looks up the values for alpha, rho1, rho2 and then it finds gamma on the right hand side. So it goes back to the definition of gamma and starts over. And over. And over. Until it has started over 1024 times and bails out. Is that the exactly correct definition of gamma? Can you explain precisely what you mean gamma to be? You also seem to have a missing ) inside your definition of f. – Bill Dec 16 '18 at 19:53Set( = ) andSetDelayed( := ). There is a discussion of it here – m_goldberg Dec 17 '18 at 01:25