# derivation2 .pdf

### File information

Original filename: derivation2.pdf
Author: Felix

This PDF 1.5 document has been generated by MicrosoftÂ® Word 2010, and has been sent on pdf-archive.com on 03/07/2017 at 20:59, from IP address 138.246.x.x. The current document download page has been viewed 328 times.
File size: 564 KB (13 pages).
Privacy: public file

derivation2.pdf (PDF, 564 KB)

### Document preview

Let dragonite and snorlax battle. Let’s define a few variables first:
Let “ p” be the fraction of the time snorlax is using his fast move, so that (1time snorlax is using his charge move.

p) is the fraction of the

̅̅̅̅̅ is snorlax’s average dps over a cycle (the “–“ stands for average)
𝑑𝑝𝑠
Fdmg is the damage done by snorlax’s fast move(to dragonite)
Fduration is the damage done by snorlax’s fast move(to dragonite)
Cdmg is the damage done by snorlax’s charge move(to dragonite), or “cinematic move” as titled in
niantic’s GAMEMASTER file.
similarly

Cdmg is the damage done by dragonite’s charge move(to snorlax).

The rest of the variables follow the same scheme.
̅̅̅̅̅
𝑑𝑝𝑠 =

̅̅̅̅̅
𝑑𝑝𝑠 =

𝑝∗(

𝑝∗(

𝐹𝑑𝑚𝑔
𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐹𝑑𝑚𝑔

) + (1 −

) + (1 −

𝑝) ∗ (

so once we find out
If

p and

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐶𝑑𝑚𝑔

𝑝) ∗ (

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐶𝑑𝑚𝑔

)

)

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

̅̅̅̅̅. That is the hard part. Let’s do it.
p we have formulas for their 𝑑𝑝𝑠

̅̅̅̅̅̅ is the averge energy gain per second of dragonite (only including gains, so no losses from
𝐸𝑃𝑆

charge moves) then

1
̅̅̅̅̅̅
𝐸𝑃𝑆

is the number of seconds to gain one energy, so

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡
̅̅̅̅̅̅
𝐸𝑃𝑆

is the average

number of seconds needed to gain enough energy to do a charge move.
Now notice that (for either
Suppose that

or

):

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡 = 50 (for example dragon claw, which takes 50 energy). And note that

𝑝, the fraction of the time dragonite spends using his fast move, is also the fraction of the time that
he has less than 50 energy (in a weave):
𝑝=

̅̅̅̅̅̅ per cycle that dragonite spends with &lt; 50 energy)
(𝑡𝑖𝑚𝑒
̅̅̅̅̅̅ 𝑝𝑒𝑟 𝑐𝑦𝑐𝑙𝑒 𝑠𝑝𝑒𝑛𝑡 𝑤𝑖𝑡ℎ &lt; 50 𝑒𝑛𝑒𝑟𝑔𝑦) + (𝑡𝑖𝑚𝑒
̅̅̅̅̅̅ 𝑝𝑒𝑟 𝑐𝑦𝑐𝑙𝑒 𝑠𝑝𝑒𝑛𝑡 𝑤𝑖𝑡ℎ ≥ 50 𝑒𝑛𝑒𝑟𝑔𝑦)
(𝑡𝑖𝑚𝑒

(the denominator is also just equal to the total time of a cycle)

Next, notice that:
-The time spent with ≥ 50 energy is just (approximately) the time it takes to shoot off a cinematic move.
In other words for dragonite:
̅̅̅̅̅̅ spent with ≥ 50 energy) =
(𝑡𝑖𝑚𝑒

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

*^* elephant come back to this later, on average you will reach 50 enrgy during a fast move, so if on
average you get through X percent of your fast move the actual formula is
𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛 + 𝑋 ∗

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

-the time spent with less than 50 energy is equal to the avg time required to get 50 energy, which we
just calculated half a page ago:
̅̅̅̅̅̅ 𝑝𝑒𝑟 𝑐𝑦𝑐𝑙𝑒 𝑠𝑝𝑒𝑛𝑡 𝑤𝑖𝑡ℎ &lt; 50 𝑒𝑛𝑒𝑟𝑔𝑦) =
(𝑡𝑖𝑚𝑒
so I now replace all those into the formula, using
(

𝑝=

(

𝑝=

This formula works for

̅̅̅̅̅̅
𝐸𝑃𝑆

as an example again:
̅̅̅̅̅̅
𝐸𝑃𝑆)

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡/

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡/

We can simplify this by multiplying by

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡

̅̅̅̅̅̅
𝐸𝑃𝑆) +

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

̅̅̅̅̅̅
𝐸𝑃𝑆 on the top and bottom:
𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡 +

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛 ∗

̅̅̅̅̅̅
𝐸𝑃𝑆

as well.

Let’s count how many equations and how many unkowns we will have:
̅̅̅̅̅̅
𝐸𝑃𝑆 can be expressed as a function of 𝑝 and p (if you don’t see, don’t
worry I’ll do it in a sec). We can also express ̅̅̅̅̅̅
𝐸𝑃𝑆 as a function of 𝑝 and p. When combined with

the above formula for
for

𝑝 and

𝑝 or

𝑝 we will have two equations in two variables and then we can solve

p. Let’s do it.

̅̅̅̅̅̅ be the average EPS dragonite gains just from being hurt by snorlax’s fast/charge
First, let ℎ𝑢𝑟𝑡𝐸𝑃𝑆
damage weave. Then
̅̅̅̅̅̅ =
𝐸𝑃𝑆

𝑝∗(

̅̅̅̅̅̅ +
ℎ𝑢𝑟𝑡𝐸𝑃𝑆

𝐹𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛
𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

We can simplify this by distributing everything and canceling:

) + (1 −

𝑝) ∗

̅̅̅̅̅̅
ℎ𝑢𝑟𝑡𝐸𝑃𝑆

̅̅̅̅̅̅
𝐸𝑃𝑆 =

𝑝∗

𝐹𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛
𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

̅̅̅̅̅̅
ℎ𝑢𝑟𝑡𝐸𝑃𝑆

+

Since Fenergygain and Fduration are in the GM file, we just need hurtEPS. Total hurt EPS is a
combination of fast hurt EPS and cinematic hurt EPS:
̅̅̅̅̅̅ =
ℎ𝑢𝑟𝑡𝐸𝑃𝑆

̅̅̅̅̅̅) + (1 −
𝐹ℎ𝑢𝑟𝑡𝐸𝑃𝑆

𝑝∗(

Yay, now we’re getting to the dependence of all of this on
together.

𝑝) ∗ (

̅̅̅̅̅̅)
𝐶ℎ𝑢𝑟𝑡𝐸𝑃𝑆

p so that we can connect everything

̅̅̅̅̅̅ and 𝐶ℎ𝑢𝑟𝑡𝐸𝑃𝑆
̅̅̅̅̅̅. First, according to testing by u/homu from
Let’s get formulas for 𝐹ℎ𝑢𝑟𝑡𝐸𝑃𝑆
pokemongo.gamepress.gg, the formula for energy gain based on damage taken is:
𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛 = 𝑐𝑒𝑖𝑙 (

𝑑𝑚𝑔
)
2

...where the ceil() function just rounds the argument up towards +∞. So ceil(2.1) = 3, ceil(2) = 2,
ceil(3.5)=4, etc.
That means that

̅̅̅̅̅̅ =
𝐹ℎ𝑢𝑟𝑡𝐸𝑃𝑆

𝑐𝑒𝑖𝑙 (

𝐹𝑑𝑚𝑔/2)

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛
̅̅̅̅̅̅ =
𝐶ℎ𝑢𝑟𝑡𝐸𝑃𝑆

𝑐𝑒𝑖𝑙 (

𝐶𝑑𝑚𝑔/2)

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛
Shit, that’s a lot of equations. But now let’s plug everything back in and just get one formula.
̅̅̅̅̅̅ =
ℎ𝑢𝑟𝑡𝐸𝑃𝑆

̅̅̅̅̅̅) + (1 −
𝐹ℎ𝑢𝑟𝑡𝐸𝑃𝑆

𝑝∗(

𝑝) ∗ (

̅̅̅̅̅̅)
𝐶ℎ𝑢𝑟𝑡𝐸𝑃𝑆

So with plugging in, it’s

̅̅̅̅̅̅ =
ℎ𝑢𝑟𝑡𝐸𝑃𝑆

𝑝∗

𝑐𝑒𝑖𝑙 (

𝐹𝑑𝑚𝑔/2)

+ (1 −

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝑝) ∗

𝑐𝑒𝑖𝑙 (

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

Cool. And before that, we had
̅̅̅̅̅̅ =
𝐸𝑃𝑆
So now that turns into:

𝑝∗

𝐹𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛
𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐶𝑑𝑚𝑔/2)

+

̅̅̅̅̅̅
ℎ𝑢𝑟𝑡𝐸𝑃𝑆

̅̅̅̅̅̅
𝐸𝑃𝑆 =

𝐹𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛

𝑝∗

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

+

𝑝∗

𝑐𝑒𝑖𝑙 (

𝐹𝑑𝑚𝑔/2)

+ (1 −

𝑝) ∗

𝑐𝑒𝑖𝑙 (

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐶𝑑𝑚𝑔/2)

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

The next formula we’d have to plug into would be the ole’
𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡

𝑝=

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡 +

But that’s horrible, HORRIBLE so let’s at least solve for

̅̅̅̅̅̅
𝐸𝑃𝑆

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛 ∗
̅̅̅̅̅̅ first.
𝐸𝑃𝑆

Multiply by the denominator:
𝑝∗(
Divide by

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡 +

𝑝, and then subtract
𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛 ∗

̅̅̅̅̅̅ = (
𝐸𝑃𝑆

̅̅̅̅̅̅ =
𝐸𝑃𝑆

𝑝∗

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡:

Simplify the right hand side and divide by

Now let’s plug in

̅̅̅̅̅̅) =
𝐸𝑃𝑆

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛 ∗

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡/

𝑝) −

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛:
𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡
𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

∗(

1
𝑝

− 1)

̅̅̅̅̅̅
𝐸𝑃𝑆 (oh god.....)

𝐹𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛
𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛
=

𝑐𝑒𝑖𝑙 (
+

𝐹𝑑𝑚𝑔
)
2

𝑝∗

𝑐𝑒𝑖𝑙 (
+ (1 −

𝐶𝑑𝑚𝑔
)
2

𝑝) ∗

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛
𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡
1
∗(
− 1)
𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛
𝑝

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

Okay, well at least we’ve made progress: notice that this equation only depends on 𝑝 and 𝑝
because everything else is just a number from the GAME_MASTER file. This is the equation we got from
choosing to follow dragonite’s EPS, but if we had chosen to calculate snorlax’s EPS, we would have
gotten the same formula except you’d have to replace all instances of
replace all instances of
THEM?

with

with

, and you’d have to

. That gives two formulas in two unknowns. CAN WE SOLVE FOR

Right now I’m praying that these two equations have a solution. But never in hell would I try to solve
this system of equations by hand. Let’s plug into Mathematica instead...

Solve[{dcduration ∗ (dp ∗ dfenergygain⁄dfduration + sp ∗ (0.5 ∗ sfdmg + 0.25)⁄sfduration + (1
− sp) ∗ (0.5 ∗ scdmg + 0.25)⁄scduration) =
= dcenergycost ∗ (1⁄dp − 1), scduration ∗ (sp ∗ sfenergygain⁄sfduration + dp
∗ (0.5 ∗ dfdmg + 0.25)⁄dfduration + (1 − dp) ∗ (0.5 ∗ dcdmg + 0.25)⁄dcduration)
== scenergycost ∗ (1⁄sp − 1)}, {dp, sp}]
...
(after 3 hours mathematica returned a 98,899 page totally incomprehensible “solution”)
...
...SHIT, mathematica can’t solve it. OK what the hell I’ll do it by hand. Since everything is horrible I will
make the following variable remanings:
𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡

𝑎=

𝑏=

𝐹𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝑐𝑒𝑖𝑙(

𝐹𝑑𝑚𝑔/2)

𝑐=

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝑐𝑒𝑖𝑙(

𝐶𝑑𝑚𝑔/2)

𝑑=
𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

Now we have:
𝑝∗𝑏+

𝑝 ∗ 𝑐 + (1 −

𝑝) ∗ 𝑑 = 𝑎 ∗ (

1
𝑝

− 1)

It will help later on to realize that a, b, c, d are all positive numbers (in fact each of their numerators and
denominators are also positive)
Multiply by

𝑝 and move the constants to the beginning of each term for neatness:
𝑏∗(

2

𝑝) + 𝑐 ∗

𝑝∗

𝑝 (1 −

𝑝+𝑑∗

𝑝) = 𝑎 ∗ (1 −

𝑝)

Distribute everything:
2

𝑏∗(
Factor out

𝑝∗

𝑝) + 𝑐 ∗

𝑝∗

𝑝+𝑑∗

𝑝−𝑑∗

𝑝∗

𝑝 =𝑎−𝑎∗

𝑝

𝑝:
𝑏∗(

2

𝑝) + (𝑐 − 𝑑) ∗

𝑝∗

𝑝+𝑑∗

𝑝 =𝑎−𝑎∗

𝑝

Subtract the right hand side stuff over to the left hand side, and move the snorlax term to the RHS.
𝑏∗(
To solve for

2

𝑝) + 𝑑 ∗

𝑝+𝑎∗

𝑝 − 𝑎 = (𝑑 − 𝑐) ∗

𝑝, divide by the other stuff on the RHS:

𝑝∗

𝑝

2

𝑏∗(

𝑝) + 𝑑 ∗

𝑝+𝑎∗

(𝑑 − 𝑐) ∗

𝑝−𝑎

𝑝

=

𝑝

𝑝 terms on the numerator:

And to neaten it up, group the

2

𝑏∗(

𝑝) + (𝑑 + 𝑎) ∗
(𝑑 − 𝑐) ∗

𝑝−𝑎

=

𝑝

𝑝

We’ve now solved for 𝑝 in the dragonite equation, but we would need to solve for it in the snorlax
equation too, which will be a bitch. Let’s start at the 3rd equation above this line, but replace all snorlax
with dragonite and vice versa to get the snorlax equation:
2

𝑏∗(

𝑝) + 𝑑 ∗

𝑝+𝑎∗

𝑝 − 𝑎 = (𝑑 − 𝑐) ∗

𝑝∗

𝑝

..but wait, that equation is wrong because we also have to switch the snorlax and dragonites in the
constants a, b, c, d. I will now make new variables:

𝑒=

𝐶𝑒𝑛𝑒𝑟𝑔𝑦𝑐𝑜𝑠𝑡

𝐹𝑒𝑛𝑒𝑟𝑔𝑦𝑔𝑎𝑖𝑛

𝑓=

𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝑐𝑒𝑖𝑙(

𝐹𝑑𝑚𝑔/2)

𝑔=

𝑐𝑒𝑖𝑙(

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐹𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

𝐶𝑑𝑚𝑔/2)

ℎ=
𝐶𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

These constants are in the same order as before but with snorlax and dragonite switched, and with abcd
renamed to efgh. So the snorlax formula actually reads
2

𝑓∗(

𝑝) + ℎ ∗

𝑝+𝑒∗

𝑝 − 𝑒 = (ℎ − 𝑔) ∗

𝑝∗

𝑝

subtract the RHS away:
2

𝑓∗(
combine the

𝑝) + ℎ ∗

𝑝+𝑒∗

𝑝 + (𝑔 − ℎ) ∗

𝑝∗

𝑝−𝑒 =0

𝑝 terms on the LHS:
2

𝑓∗(

𝑝) + (ℎ + 𝑒 + (𝑔 − ℎ) ∗

𝑝) ∗

𝑝−𝑒 =0

This is a quadratic equation. If you’re up to this point you must know the quadratic equation:
−𝐵 ± √𝐵2 − 4 ∗ 𝐴 ∗ 𝐶
2∗𝐴
For us that translates to:

𝑝=

𝑝) + 4 ∗ 𝑓 ∗ 𝑒

2∗𝑓
𝑝 from before:

Great! Let’s set it equal to the other
𝑏∗(

2

𝑝) ± √(ℎ + 𝑒 + (𝑔 − ℎ) ∗

− (ℎ + 𝑒 + (𝑔 − ℎ) ∗

2

𝑝) + (𝑑 + 𝑎) ∗
(𝑑 − 𝑐) ∗

𝑝−𝑎

𝑝
2

𝑝) ± √(ℎ + 𝑒 + (𝑔 − ℎ) ∗

− (ℎ + 𝑒 + (𝑔 − ℎ) ∗
=

𝑝) + 4 ∗ 𝑓 ∗ 𝑒

2∗𝑓

Goddamn I never thought pokemon could be such a mess. Okay folks, you know the deal, get rid of
those denominators:
2 ∗ 𝑓 ∗ (𝑏 ∗ (

2

𝑝) + (𝑑 + 𝑎) ∗

𝑝 − 𝑎)

= −(𝑑 − 𝑐) (ℎ + 𝑒 + (𝑔 − ℎ) ∗
± (𝑑 − 𝑐) ∗

𝑝) ∗

𝑝√(ℎ + 𝑒 + (𝑔 − ℎ) ∗

𝑝
2

𝑝) + 4 ∗ 𝑓 ∗ 𝑒

Move over the first term on the RHS and reorder that term a bit:
2 ∗ 𝑓 ∗ (𝑏 ∗ (

2

𝑝) + (𝑑 + 𝑎) ∗
= ±(𝑑 − 𝑐) ∗

Let’s factor the LHS by powers of

𝑝 − 𝑎) + (𝑑 − 𝑐) ∗
𝑝√(ℎ + 𝑒 + (𝑔 − ℎ) ∗

𝑝 ∗ (ℎ + 𝑒 + (𝑔 − ℎ) ∗

𝑝)

2

𝑝) + 4 ∗ 𝑓 ∗ 𝑒

𝑝. But first distribute. Each line is one of the terms:

𝐿𝐻𝑆 = 2 ∗ 𝑓 ∗ 𝑏 ∗ (

2

𝑝) + 2 ∗ 𝑓 ∗ (𝑑 + 𝑎) ∗

+(𝑑 − 𝑐) ∗ (ℎ + 𝑒) ∗

𝑝−2∗𝑓∗𝑎

𝑝 + (𝑑 − 𝑐) ∗ (𝑔 − ℎ) ∗ (

= (2 ∗ 𝑓 ∗ 𝑏 + (𝑑 − 𝑐) ∗ (𝑔 − ℎ)) ∗ (

𝑝)

+(2 ∗ 𝑓 ∗ (𝑑 + 𝑎) + (𝑑 − 𝑐) ∗ (ℎ + 𝑒)) ∗

𝑝)

2

2

𝑝

−2 ∗ 𝑓 ∗ 𝑎
I hate to be the bringer of bad news but now we must square both sides of the equation to get rid of the
root. OASIOAISJFOAA! Here’s the result:

2

2

[(2 ∗ 𝑓 ∗ 𝑏 + (𝑑 − 𝑐) ∗ (𝑔 − ℎ)) ∗ (

𝑝) + (2 ∗ 𝑓 ∗ (𝑑 + 𝑎) + (𝑑 − 𝑐) ∗ (ℎ + 𝑒)) ∗
2

= (𝑑 − 𝑐)2 ∗ (

𝑝 − 2 ∗ 𝑓 ∗ 𝑎]

2

𝑝) ∗ (ℎ + 𝑒 + (𝑔 − ℎ) ∗

𝑝) + 4 ∗ 𝑓 ∗ 𝑒

Let’s simplify the RHS. Note that
2

𝑝) = (ℎ + 𝑒)2 + 2 ∗ (ℎ + 𝑒) ∗ (𝑔 − ℎ) ∗

(ℎ + 𝑒 + (𝑔 − ℎ) ∗

𝑝 + (𝑔 − ℎ)2 ∗ (

𝑝)

And now let’s distribute the preceding factor over that term:
2

(𝑑 − 𝑐)2 ∗ (

𝑝) ∗ ((ℎ + 𝑒)2 + 2 ∗ (ℎ + 𝑒) ∗ (𝑔 − ℎ) ∗
= (ℎ + 𝑒)2 ∗ (𝑑 − 𝑐)2 ∗ (

𝑝 + (𝑔 − ℎ)2 ∗ (

𝑝)

2

+2 ∗ (ℎ + 𝑒) ∗ (𝑔 − ℎ) ∗ (𝑑 − 𝑐)2 ∗ (
+(𝑔 − ℎ)2 ∗ (𝑑 − 𝑐)2 ∗ (

𝑝)

2

𝑝) )

𝑝)

3

4

That makes the whole RHS be (in order of powers):
(𝑔 − ℎ)2 ∗ (𝑑 − 𝑐)2 ∗ (

4

𝑝) + 2 ∗ (ℎ + 𝑒) ∗ (𝑔 − ℎ) ∗ (𝑑 − 𝑐)2 ∗ (

𝑝)

3

2

+(ℎ + 𝑒)2 ∗ (𝑑 − 𝑐)2 ∗ (

𝑝) + 4 ∗ 𝑓 ∗ 𝑒

I think it’s about time to rename more stuff. I want the equation to look like this:
[𝐿 ∗ (

2

2

𝑝) + 𝑀 ∗

𝑝 + 𝑁] = 𝑃 ∗ (

4

𝑝) + 𝑄 ∗ (

3

𝑝) + 𝑅 ∗ (

For that I need to assign:
𝐿 = 2 ∗ 𝑓 ∗ 𝑏 + (𝑑 − 𝑐) ∗ (𝑔 − ℎ)
𝑀 = 2 ∗ 𝑓 ∗ (𝑑 + 𝑎) + (𝑑 − 𝑐) ∗ (ℎ + 𝑒)
𝑁 = −2 ∗ 𝑓 ∗ 𝑎
𝑃 = (𝑔 − ℎ)2 ∗ (𝑑 − 𝑐)2
𝑄 = 2 ∗ (ℎ + 𝑒) ∗ (𝑔 − ℎ) ∗ (𝑑 − 𝑐)2
𝑅 = (ℎ + 𝑒)2 ∗ (𝑑 − 𝑐)2
𝑆 =4∗𝑓∗𝑒

2

𝑝) + 𝑆

2

These new variables have the following signs (1 if &gt; 0, -1 if &lt; 0):
𝑠𝑔𝑛(𝐿) = 2 ∗ 𝑓 ∗ 𝑏 + (𝑑 − 𝑐) ∗ (𝑔 − ℎ)
𝑠𝑔𝑛(𝑀) = 1 𝑖𝑓 𝑑 &gt; 𝑐, −1 𝑖𝑓 𝑀 &lt; 0
𝑠𝑔𝑛(𝑁) = −1
𝑠𝑔𝑛(𝑃) = 1
𝑠𝑔𝑛(𝑄) = 𝑠𝑔𝑛(𝑔 − ℎ)
𝑠𝑔𝑛(𝑅) = 1
𝑠𝑔𝑛(𝑆) = 1
OK, with our new variable names let’s distribute the LHS. I will now use the fact that
(𝐴 + 𝐵 + 𝐶)2 = 𝐴2 + 𝐵2 + 𝐶 2 + 2𝐴𝐵 + 2𝐴𝐶 + 2𝐵𝐶
This makes
2

2

[𝐿 ∗ (

𝑝) + 𝑀 ∗

4

𝑝 + 𝑁] = 𝐿2 ∗ (
3

+2𝐿𝑀 ∗ (

𝑝) + 2𝐿𝑁 ∗ (

2

𝑝) + 𝑀2 ∗ (
2

𝑝) + 2𝑀𝑁 ∗

𝑝) + 𝑁 2
𝑝

Combine like-powers:
4

= 𝐿2 ∗ (

3

2

𝑝) + (2𝐿𝑁 + 𝑀2 ) ∗ (

𝑝) + 2𝐿𝑀 ∗ (

𝑝) + 2𝑀𝑁 ∗

𝑝 + 𝑁2

Now that it’s expanded, let’s plug it into what we had before, to give:
𝐿2 ∗ (

4

𝑝) + 2𝐿𝑀 ∗ (
=𝑃∗(

3

𝑝) + (2𝐿𝑁 + 𝑀2 ) ∗ (
4

𝑝) + 𝑄 ∗ (

3

2

𝑝) + 2𝑀𝑁 ∗

𝑝) + 𝑅 ∗ (

𝑝 + 𝑁2

2

𝑝) + 𝑆

Move everything to the LHS:
𝐿2 ∗ (

4

3

𝑝) + (2𝐿𝑁 + 𝑀2 ) ∗ (

𝑝) + 2𝐿𝑀 ∗ (
∗(

3

𝑝) − 𝑅 ∗ (

2

𝑝) + 2𝑀𝑁 ∗

𝑝 + 𝑁2 − 𝑃 ∗ (

4

𝑝) − 𝑄

2

𝑝) − 𝑆 = 0

Order by power:
𝐿2 ∗ (

4

𝑝) − 𝑃 ∗ (

4

𝑝) + 2𝐿𝑀 ∗ (

3

𝑝) − 𝑄 ∗ (

3

𝑝) + (2𝐿𝑁 + 𝑀2 ) ∗ (

2

𝑝) − 𝑅 ∗ (

𝑝)

2

#### HTML Code

Copy the following HTML code to share your document on a Website or Blog

#### QR Code ### Related keywords 