mmamathes
(Bill Blair)
January 2, 2026, 11:44am
1
f[x_] = -(((3 Sqrt[E])/2 - x) (1 - Log[2 Sqrt[E] - x])) + (-(Sqrt[E]/
2) + x) (1 - Log[x])
g[x_] = PowerExpand /@ (D[f[x], {x, 1}] // FullSimplify)
How to display the derivative result in the desired form?
E/((2 Sqrt[E] - x) x) - Log[x (2 Sqrt[E] - x)]
Here are a couple of ways:
g[x] /. Log[a_] + Log[b_] :> Log[a*b] // Apart
Simplify[g[x], 2 Sqrt[E] - x > 0] // Apart
mroge02
(Michael Rogers)
January 2, 2026, 7:29pm
3
A minimum requirement: For the simplify function to combine logarithms, they need to be told the arguments are real through assumptions.
Aside from that, you need to make the desired form seem less complex than the default result. That can be achieved through the ComplexityFunction option.
One solution, that penalizes excessive Log[]s:
f[x_] = -(((3 Sqrt[E])/2 - x) (1 - Log[2 Sqrt[E] - x])) + (-(Sqrt[E]/
2) + x) (1 - Log[x])
dom = FunctionDomain[f[x],x]
g[x_] = PowerExpand /@ (D[f[x], {x, 1}] //
FullSimplify[#
, dom
, ComplexityFunction -> (LeafCount[#] + 5 Count[#, _Log, Infinity]&)
]&)
Oddball solution:
f[x_] = -(((3 Sqrt[E])/2 - x) (1 - Log[2 Sqrt[E] - x])) + (-(Sqrt[E]/
2) + x) (1 - Log[x]);
g[x_] = PowerExpand /@ (D[f[x], {x, 1}] // FullSimplify);
dom = FunctionDomain[f[x], x]
Collect[
g[x]/.ln_Log:>Hold[1]ln
,Hold[1]
,Simplify[#, dom, ComplexityFunction -> LeafCount]&
] // ReleaseHold
Note: LeafCount gives a slightly different measure of complexity than the default measure Simplify`SimplifyCount:
Simplify`SimplifyCount[-(E/(x*(-2*Sqrt[E] + x)))]
Simplify`SimplifyCount[E/(2*Sqrt[E]*x - x^2)]
(*
Out[122]= 21
Out[123]= 20
*)
LeafCount[-(E/(x*(-2*Sqrt[E] + x)))]
LeafCount[E/(2*Sqrt[E]*x - x^2)]
(*
Out[126]= 17
Out[127]= 18
*)
mmamathes
(Bill Blair)
January 3, 2026, 2:38pm
4
The ComplexityFunction command turns out to be extremely powerful for simplifying results—looks like I need to study its usage seriously. Thanks again for your help.
mmamathes
(Bill Blair)
January 3, 2026, 2:38pm
5
This method is remarkably concise.