0
$\begingroup$

I know how to expand brackets such as the following in general, using the foil or crab-claw methods, but my tutor mentioned that there is a universal formula/algorithm for an expansion.

E.g Bracket:

(x + y) (2x - 7xy)

Please can you tell me what it is?

Thanks,

Max.

  • 0
    @Joe no, I'm not.2012-10-01

2 Answers 2

1

It is just applying the distributive law repeatedly ($a(b+c) = ab + ac$), adding the exponents of terms with a common base (e.g., $(x)(2x)$ becomes $2x^2$), and collecting terms with the same bases and exponents (e.g., $(-7xy) + (2xy)$ becomes $-5xy$). You keep on doing this until nothing else can be done.

In your case, as Robert Israel stated, the distributive law applied twice gives $(x)(2x)+(x)(−7xy)+(y)(2x)+(y)(−7xy)$. Adding the exponents of parts of terms with common bases gives $(2x^2)-(7x^2y)+(2xy)-(7xy^2)$. There are no terms with the sames bases and exponents, so you can remove the parentheses and you are done.

  • 0
    @MJD: this is certainly (a sketch of) an algorithm-a well-defined series of steps that leads to the solution. It is recursive, in that it breaks the problem at hand down to a simpler version, then says to do to the same to the simpler version. It is not a formula like (a+b)(c+d)=ac+ad+bc+bd, but those get hard to right out for an unknown number of terms. I could certainly write $(\sum a_i)(\sum b_j)=\sum\sum a_ib_j$, which is true, but doesn't feel like what you want in a formula either.2012-10-01
0

Perhaps by "something fancy" you mean this. Suppose each of your sums is a polynomial in $x$. Thus you want to write $(a_0 + a_1 x + a_2 x^2 + \ldots + a_m x^m)(b_0 + b_1 x + \ldots + b_n x^n) = c_0 + c_1 x + \ldots + c_{m+n} x^{m+n}$ where the coefficients $a_j, b_j, c_j$ don't contain $x$.
Then $c_k = \sum_{i=\max(0,i-n)}^{\min(m,k)} a_i b_{k-i}$ But there's also an asymptotically much faster way to compute the coefficients, using Fast Fourier Transform and interpolation. See e.g. http://www.cs.iastate.edu/~cs577/handouts/polymultiply.pdf