Can anyone help me simplify/factorise the expressions below?

80 Views Asked by At

I would really appreciate it if anyone who is adept at factorising/simplifying algebraic expressions could help me out with those below. My reason for needing to simplify them is computational efficiency - I'd like to reduce the number of floating point operations for each expression as much as possible (these expressions get called in a routine that's run very frequently in my code). Additionally, I plan to put this math in a future paper, so I would like it to be as neat as possible.

Can anyone spot any patterns to simplify any (ideally all) of the expressions below? I have tried expanding all the terms, but I end up no where.

\begin{align} A = 5x_0^4 + 10x_0^3\Delta x + 10x_0^2\Delta x^2 +5x_0\Delta x^3 + \Delta x^4 \end{align}

\begin{eqnarray} B = 20x_0^3y_0 + 10x_0^2[3y_0\Delta x + x_0\Delta y] + 20x_0\Delta x[x_0\Delta y + y_0\Delta x] + 5\Delta x^2[3x_0\Delta y + y_0\Delta x] + 4\Delta x^3\Delta y \end{eqnarray}

\begin{eqnarray} C = 30x_0^5 + 75x_0^4\Delta x + 100x_0^3\Delta x^2 + 75x_0^2\Delta x^3 + 30x_0\Delta x^4 + 6\Delta x^5 \end{eqnarray}

\begin{eqnarray} D = 60x_0^4y_0 + 30x_0^2[4y_0\Delta x + x_0^2\Delta y] + 40x_0^2\Delta x[2x_0\Delta y + 3y_0\Delta x] + 30x_0\Delta x^2[3x_0\Delta y + 2y_0\Delta x] + 12\Delta x^3[4x_0\Delta y + y_0\Delta x] + 10\Delta x^4\Delta y \end{eqnarray}

\begin{eqnarray} E = 60x_0^3y_0^2 + 30x_0^2y_0[3y_0\Delta x + 2x_0\Delta y] + 20x_0[x_0^2\Delta y^2 + 6x_0y_0\Delta x\Delta y + 3y_0^2\Delta x^2] + 15\Delta x[3x_0^2\Delta y^2 + 6x_0y_0\Delta x\Delta y + y_0^2\Delta x^2] + 12\Delta x^2\Delta y[3x_0\Delta y + 2y_0\Delta x] + 10\Delta x^3\Delta y^2 \end{eqnarray}

where $\Delta x\!=\!(x_1-x_0)$ and $\Delta y\!=\!(y_1-y_0)$. For those of you who are interested/curious about the origins of the above expressions, each term above features in the derivation of the expressions $\iint_{\Omega}\phi\ dxdy$, where $\phi\in\{x^3,\ x^2y,\ x^4,\ x^3y,\ x^2y^2\}$ and $\Omega$ is an arbitrary simple polygon in the $z\!=\!0$ plane whose vertices are sorted CCW. Green's theorem is applied in reverse (from the area integral to a line integral). Green's theorem states

\begin{align} \iint_{\Omega}\left(\frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y}\right)\ dxdy = \oint_{\partial\Omega}Pdx+Qdy \end{align}

where $\partial\Omega$ is the boundary of $\Omega$. Using the above, I make the following choices for the functions $P$ and $Q$, for the corresponding expression of $\iint_{\Omega}\phi\ dxdy$ for each term $\phi$,

$\mathbf{\phi=x^3}\ $: $\ Q\!=\!\frac{x^4}{4}, \ P\!=\!0$

$\mathbf{\phi=x^2y}\ $: $\ Q\!=\!\frac{x^3y}{3}, \ P\!=\!0$

$\mathbf{\phi=x^4}\ $: $\ Q\!=\!\frac{x^5}{5}, \ P\!=\!0$

$\mathbf{\phi=x^3y}\ $: $\ Q\!=\!\frac{x^4y}{4}, \ P\!=\!0$

$\mathbf{\phi=x^2y^2}\ $: $\ Q\!=\!\frac{x^3y^2}{3}, \ P\!=\!0$

This is then utilised by expressing

\begin{align} \iint_{\Omega} \phi \ dxdy = \oint_{\partial\Omega}Q_{\phi}(x,y)dy = \sum_{i=1}^n \int_0^1 Q_{\phi}\big(x(t),y(t)\big) (y_{i+1}\!-\!y_{i}) dt \end{align}

where $n$ is the number of edges in the polygon $\Omega$, and the parameter $t$ is introduced by expressing each edge $<\!\mathbf{x}_i,\mathbf{x}_{i+1}\!>$, of the polygon by

\begin{eqnarray} x(t) = x_i + (x_{i+1}-x_{i})t \\ y(t) = y_i + (y_{i+1}-y_{i})t \end{eqnarray}

with $t\!\in\![0,1]$. From the above, $dy=(y_{i+1}\!-\!y_{i})dt$, as seen previously. Note that $i\!+\!1$ wraps back to $1$ when $i\!=\!n$.

It is clear that the choices for the functions $P$ and $Q$ impacts the complexity of the ensuing expressions for $\iint_{\Omega}\phi\ dxdy$. I took the `simplest' approach and set $P=0$ from the get go. I'm not insightful enough to see if there was a better way to choose $P$ and $Q$ to result in simpler expressions. Any insight (into better choices for $P$ and $Q$, or simplifications of the expressions $A$-$B$) would be much appreciated!

1

There are 1 best solutions below

3
On

$A$ resembles a binomial expansion with the first term missing, so it is

$\displaystyle A=\frac{(x_0+(x_1-x_0))^5-x_0^5}{x_1-x_0} = \frac{x_1^5-x_0^5}{x_1-x_0}$

Coefficients in $C$ are $5$ times the $6$th row in Pascal's triangle, with the missing first term and $+1$ on coefficient of the final term, so it is:

$\displaystyle C = 5\frac{(x_0+(x_1-x_0))^6-x_0^6}{x_1-x_0}+(x_1-x_0)^5 = 5\frac{x_1^6-x_0^6}{x_1-x_0}+(x_1-x_0)^5$

You may get more answers for the other expressions if you can explain where they come from. The symmetry of co-efficients suggests they are not just random expressions !