# Solving systems of equations with simple implicit functional relations

I am attempting to solve five variables from a system of equations. Let the variables be $$x_1,x_2,x_3,x_4,x_5$$. Let the problem have the form:

$$\exp(x_1)+x_1^6=x_3+x_4+x_5 \tag{1}$$ $$\exp(x_2)+x_2^6=x_3+x_4+x_5 \tag{2}$$ $$f_1(x_1,x_2,x_3,x_4,x_5)=0 \tag{3}$$ $$f_2(x_1,x_2,x_3,x_4,x_5)=0 \tag{4}$$ $$f_3(x_1,x_2,x_3,x_4,x_5)=0 \tag{5}$$

Here $$f_1,f_2,f_3$$ are some generally complicated functions. I am looking for the most efficient way to solve this problem.

One can see that I can solve for the first two variables simply from the first two equations and represent them as $$x_1=g_1(x_3,x_4,x_5)$$ and $$x_2=g_2(x_3,x_4,x_5)$$. If $$g_1$$ and $$g_2$$ were analytic, I could simply plug the first two variables to the last three equations and solve for a much simpler three equation problem, which would typically improve both speed and accuracy. However, the issue is that here $$g_1$$ and $$g_2$$ cannot be derived analytically and hence the relationship is implicit.

I have tried a nested solution approach, where for each guess value for the last three variables I numerically solve for the first two from the first two equations. However, this does not appear to improve speed much over simply giving a standard solver a full problem with 5 equations and unknowns.

Could someone suggest an alternative solution approach?

• What can you do with $f$? Only evalute it? – user3680510 Feb 17 at 13:58
• @user3680510 $f$ is essentially a known but complicated polynomial expression, it could be something like $f_1(x_1,x_2,x_3,x_4,x_5)=x_1x_2x_3+exp(x_1)+x_2+x_3x_4x_5$. I think specifying it is not necessary to answer the question as this needs to be feeded to a numerical solver anyway. – fesman Feb 17 at 14:39
• With a good nonlinear programming solver, calling $g_1(x_1,x_2,x_3,x_4)=\exp(x_1)+x_1^6=x_3+x_4+x_5$ and $g_2(x_1,x_2,x_3,x_4) = \exp(x_2)+x_2^6=x_3+x_4+x_5$ we can proceed as $$\min_X (\|g_1\|+\|g_2\|+\|f_1\|+\|f_2\|+\|f_3\|)$$ choosing a differential evolution approach. – Cesareo Feb 23 at 16:54