Unable to solve equation explicitely

asked 2023-10-03 04:05:31 +0200

updated 2023-10-03 08:30:47 +0200

Emmanuel Charpentier gravatar image

I have the following equation:

U=(8*pi*h*f^3)/(c^3)/(exp((h*f)/(k*T))-1),

and I would like to solve it's derivative with respect to f equal to zero for f. I know this equation can be explicitly solved for f with the LambertW function, however sage only provides an implicit solution, or if I specify it must be explicit, it only gives the trivial solution. Is there any way to get it to use the LambertW function when using solve?

edit retag flag offensive close merge delete

Comments

Edited for legibility : to quote code, indent it by four spaces...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-10-03 08:56:05 +0200 )edit

For the benefit of future commenters/answerers, a bit of Sage code :

sage: var("U, h, f, c, k, T")
(U, h, f, c, k, T)
sage: U=(8*pi*h*f^3)/(c^3)/(exp((h*f)/(k*T))-1)

Sage gives indeed an implicit answer :

sage: solve(diff(U, f)==0, f)
[f == 0, f == 3*(T*k*e^(f*h/(T*k)) - T*k)*e^(-f*h/(T*k))/h]

Neither Sympy, Giac nor Fricas can solve this one.Mathematica gives an explicit answer using Lambert's W :

sage: mathematica.Reduce(diff(U, f)==0, f)
Element[C[1], Integers] && h != 0 && 
 c*(-1 + E^(3 + ProductLog[C[1], -3/E^3]))*k*T != 0 && 
 f == (k*T*(3 + ProductLog[C[1], -3/E^3]))/h

ProductLog being indeed Marhematica's name for Lambert's W.

HTH,

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-10-03 09:29:25 +0200 )edit

It is easy to solve the equation manually using the definition of Lambert W function.

Max Alekseyev gravatar imageMax Alekseyev ( 2023-10-03 13:23:11 +0200 )edit