I have something like this:
Solve[f[x] == g[x] / h[x], x]
where g[x]
are symbolic mononomials in x
(eg a[i] b[1] x
for i=1,...,n
) and, similarly, f[x]
is a monomial in x
eg b[1](1-x)
.
I want to solve the equation for x
, but Mathematica complains that This system cannot be solved with the methods available to Solve.
.
I understand that the reason Solve
issues the Solve::nsmet
message is due to the fact that there is h[x]
in the denominator.
h[x]
is an expression that is dependent upon x
, but its exact dependence is not essential for the purpose at hand (think of it as a constant that just has to bear a sign reminding the user that it is-somewhere down along the line of computations-dependent upon x
).
I understand that I can Solve
the problem by simply removing the dependence of h
on x
eg
{sol} = Solve[{f[x] == g[x] / h, x]
will return
{{x->h/(h+Sum[a[i],{i,1,n}])}}
and I can, in turn, be explicit about h
's dependence upon x
with doing something like eg
sol = sol/.h->h[x]
that returns
{x->h[x]/(h[x]+Sum[a[i],{i,1,n}])}
I am asking if there is a less round-about way to achieve the same result.
x
if you're writing it in terms ofh[x]
. It's fine if that's what you want to do, but it's no surprise thatSolve
doesn't do it. $\endgroup$h
is to have itsx
-dependence ignored (with something likeignoreDependence[ h, x, Solve[ ... ] ]
, or do you want the function to be able to 'seek out' unevaluated functions such ash
? (The latter case is harder to write and test; you'd probably need to specify more about what kind of functionsh
can appear; and I'm not entirely sure the solution would be well-defined.) $\endgroup$h[x]
is not actually a function ofx
like egf[x]=b[1](1-x)
is; it can be considered an expression with headh
and bodyx
; for the purposes ofSolve
,h
should be treated as a quantity free ofx
; I understand that what I'm saying might sound weird but in the context I'm working on it makes sense; a wrapper function makes sense as it would essentially automate the process I described in the question; I was hoping there would be a more elegant way of doing it (perhapsHold
-ing something or whatever) $\endgroup$