News for hackers. Stuff that matters.
Re:Decomposing a function into its even and odd parts by panic on Saturday July 30, 2016 @09:39PM (#12195361)
The odd/even parts of a function are unique, so no.

To see why they're unique, say you have two pairs of odd/even functions fo1/fe1 and fo2/fe2 that each sum to the same function. Subtract fo1 from both sides:

    fo1 + fe1 = fo2 + fe2
          fe1 = fo2 - fo1 + fe2
Since fe1 is even, fo2 - fo1 + fe2 must also be even. The function fo2 - fo1 is the difference of two odd functions, so it is itself an odd function. And the only way the sum of an odd function (fo2 - fo1) and an even function (fe2) can be even is if the odd function is everywhere zero [1]. In other words, fo2 - fo1 = 0, which means fo2 = fo1. Substituting this into the overall equation, that means fe1 = fe2 as well.

[1] the sum is even when

    odd(x) + even(x) = odd(-x) + even(-x)
                     = -odd(x) + even(x)
              odd(x) = -odd(x)
and the only number which is its own negative is zero.
Re:Decomposing a function into its even and odd parts by mjd on Sunday July 31, 2016 @11:19AM (#12197321)
I think it's a little simpler to observe that

    fo1 - fo2 = fe1 - fe2
The left side is an odd function and the right side is an even function, so the common value must be both odd and even. But only the zero function is both odd and even, QED.
Re:Decomposing a function into its even and odd parts by tamana on Sunday July 31, 2016 @11:45AM (#12197408)
Your don't even need to posit fe3 and fo2:

f(X) = e(X) + o(X)

f(-X) = e(X) - o(X)

From there you can explicitly solve the system of linear equations to get e(X) and o(X)

Re:Decomposing a function into its even and odd parts by apricot on Saturday July 30, 2016 @09:52PM (#12195380)
Very nice, thank you!