# Mathematica won't solve: $(H-T)^x-(L+T)^x=x*c/p$

I'm trying to solve the equation:

((H-T)^x-(L+T)^x)/x==c/p


for T. I've tried working with Solve and Reduce and I've also tried restricting the solution to Real values only but nothing seems to work. Also, I'm not sure how to use the fact that:

Reduce[((H - T)^x - (L + T)^x)/x == c/p && p>= 0 && p <= 1 && x > 0 && x <= 1, T]


I also tried:

Solve[((H - T)^x - (L + T)^x)/x == c/p && p >= 0 && p <= 1 && x > 0 && x <= 1, T]


Any suggestions?

• It's a transcendental equation in T (bad idea to use capital letters for variables, by the way), and not in any obvious way reducible to a form Solve 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 to 0<x<=1. – Daniel Lichtblau Mar 12 '17 at 15:51
• What "error messages"/output are you getting? "nothing seems to work" doesn't tell us anything. Plus for Mathematica 10.4.1 on Windows 10 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. – JimB Mar 12 '17 at 15:55
• I have MAtheatica 9.0. The use of the Y in the first equation was a mistake. I've changed it now in the question. Thanks for letting me know. When I run the Solve function as you suggested (but with T instead of Y) I get the error notification: Solve::nsmet: This system cannot be solved with the methods available to Solve. – Nofar Duani Mar 12 '17 at 15:58

## 1 Answer

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.