# Result not simplified

The following script gives not the simplest result. What should be the right command to get the simplest result?

f[x_, y_, a_, b_] := x (a/b)^(y/x b)
g[x_, y_, a_, b_] := Log[f[x, y, a, b]]*x

• Append // PowerExpand // Expand after your result, if the variables and parameters are real valued. the function g[_] is not defined – Andreas Feb 22 at 21:48
• your g is f ? with this change, Mathematica does not think x log(x (a/b)^((b y)/x)) is correct result. You can use Reduce to check. – Nasser Feb 22 at 21:49
• @Andreas: I have corrected the typo. Your procedure gives $by \log(a)-by \log(a) + ...$ How do I then factor the terms? – Hans Feb 23 at 0:05
• Try: PowerExpand[g[x, y, a, b]] // Simplify // TraditionalForm – Daniel Huber Feb 23 at 16:05
• Append // PowerExpand // Expand // FullSimplify – Andreas Feb 23 at 16:05