# Question:factoring terms intelligently

## Question:factoring terms intelligently

Maple

> phi1[0] := unapply(`&phi;bt`[0](x, y, t, T)-2*h2*`&phi;bc`[0](x, y, t, T)/(h1+h2), x, y, t, T); phi2[0] := unapply(`&phi;bt`[0](x, y, t, T)+2*h1*`&phi;bc`[0](x, y, t, T)/(h1+h2), x, y, t, T); eta1[0] := unapply(`&eta;bt`[0](x, t, T)-2*h2*`&eta;bc`[0](x, t, T)/(h1+h2), x, t, T); eta2[0] := unapply(`&eta;bt`[0](x, t, T)+2*h1*`&eta;bc`[0](x, t, T)/(h1+h2), x, t, T); U1[0] := unapply(Ubt[0](y)-2*h2*Ubc[0](y)/(h1+h2), y); U2[0] := unapply(Ubt[0](y)+2*h1*Ubc[0](y)/(h1+h2), y);
> eqn := h1*((D(U1[0]))(1)*eta1[0](x, t, T)-(D[2](phi1[0]))(x, 1, t, T))+h2*((D(U2[0]))(1)*eta2[0](x, t, T)-(D[2](phi2[0]))(x, 1, t, T)); expand(eqn/(h1+h2)); collect(% = 0, [`&phi;bt`[0], `&phi;bc`[0], `&eta;bt`[0], `&eta;bc`[0], Ubt[0], Ubc[0], h1, h2]);
print(`output redirected...`); # input placeholder
/    h1        h2   \
|- ------- - -------| D[2](&phi;bt[0])(x, 1, t, T)
\  h1 + h2   h1 + h2/

/  h1        h2   \
+ |------- + -------| D(Ubt[0])(1) &eta;bt[0](x, t, T)
\h1 + h2   h1 + h2/

/        2            2 \
| 4 h1 h2      4 h2 h1  |
+ |---------- + ----------| D(Ubc[0])(1) &eta;bc[0](x, t, T) = 0
|         3            3|
\(h1 + h2)    (h1 + h2) /
The above equation is correct but I need to find a way to get Maple to collect the terms as I did above but also to cancel the coefficienets, some of which are simply 1, others are a bit simpler than what is shown above.  How can I do that?

﻿