When symbolic methods are not up to the task, one can try numerical methods, either NSolve
or FindRoot
.
One can make a function in a number of ways. For example, using NSolve
:
solT[H_?NumericQ, L_?NumericQ, x_?NumericQ, c_?NumericQ, p_?NumericQ] /;
p >= 0 && p <= 1 && x > 0 && x <= 1 := (* restrict domain *)
NSolve[((H - T)^x - (L + T)^x)/x == c/p, T, Reals]
We can get T
as a function of the parameters with
First[T /. solT[..]]
One problem is that, in general, there may not be exactly one solution. One could use the following instead of First
. It will give a warning, and one could adapt the behavior as desired.
firstOfOne::many = "There are `` parts; expected 1";
firstOfOne[e_] := (If[Length[e] != 1,
Message[firstOfOne::many, Length[e]]
];
First[e]);
Examples:
solT[10, 2, 0.4, 3, 1/2]
(* {{T -> -1.9517}} *)
Plot[firstOfOne[T /. solT[10, 2, x, 3, 1/2]], {x, 0, 1}]
There does not seem to be a case where there is more than one solution returned in my somewhat random testing, so maybe firstOfOne
might be overkill.
T
(bad idea to use capital letters for variables, by the way), and not in any obvious way reducible to a formSolve
might be able to handle. So i doubt there will be any general solution in terms of the unspecified parameters. For given numeric values there might be a chance, when restricted to0<x<=1
. $\endgroup$Solve[((H - T)^x - (L + y)^x)/x == c/p, T]
works fine for me. And your equations are not the same:T
appears just once in the first equation and twice in the other two equations. $\endgroup$