Question: why collect is needed to simplify an expression?

I have an expression with y,y',y''. I found that I had to use collect first to make Maple simplifies it more.

Why is that? Is this expected?

interface(version);

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

B:=-(-t^2+1)*(-diff(y(t),t$2)*(-t^2+1)^(1/2)+diff(y(t),t)/(-t^2+1)^(1/2)*t)-(2*(-t^2+1)^(1/2)-t)*diff(y(t),t)*(-t^2+1)^(1/2)+((-t^2+1)^(1/2)-t)*y(t);

-(-t^2+1)*(-(diff(diff(y(t), t), t))*(-t^2+1)^(1/2)+(diff(y(t), t))*t/(-t^2+1)^(1/2))-(2*(-t^2+1)^(1/2)-t)*(diff(y(t), t))*(-t^2+1)^(1/2)+((-t^2+1)^(1/2)-t)*y(t)

simplify(B);

((diff(diff(y(t), t), t))*t^4+2*(diff(y(t), t))*t^2*(-t^2+1)^(1/2)-2*(diff(diff(y(t), t), t))*t^2-y(t)*t^2-y(t)*(-t^2+1)^(1/2)*t-2*(diff(y(t), t))*(-t^2+1)^(1/2)+diff(diff(y(t), t), t)+y(t))/(-t^2+1)^(1/2)

B:=collect(B,{diff(y(t),t$2),diff(y(t),t),y(t)},'distributed'):
simplify(B);

2*(t^2-1)*(diff(y(t), t))+((-t^2+1)^(1/2)-t)*y(t)+(-t^2+1)^(3/2)*(diff(diff(y(t), t), t))


Download why_collect_is_needed_to_simplify_more_maple_2025_2_nov_30_2025.mw

Notice how much simpler the result when doing collect first.

Please Wait...