# Representing a real valued function as a sum of odd and even functions [duplicate]

This question already has an answer here:

With $f(x)$ being a real valued function we can write it as a sum of an odd function $m(x)$ and an even function $n(x)$: $f(x)=m(x)+n(x)$

Write an equation for $f(-x)$ in terms of $m(x)$ and $n(x)$:

My attempt using the properties - even function if: $f(x)=f(-x)$ and odd function if: $-f(x)=f(-x)$

$f(x)=m(x)+n(x) \implies f(-x)=m(-x)+n(-x) \implies f(-x)= -m(x)+n(x) \implies f(-x)=n(x)-m(x)$

I think that is correct but then I need to find equations for both $m(x)$ and $n(x)$ in terms of $f(x)$ and $f(-x)$ so a suggestion on how to tackle that would be great.

-

## marked as duplicate by Guess who it is., Micah, Amzoti, L.G., Julian KuelshammerMay 30 '13 at 15:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

## 2 Answers

$$f(x)=\frac{1}{2}\left(f(x)+f(-x)\right)+\frac{1}{2}\left(f(x)-f(-x)\right)$$

-

Add and subtract $f(x) = m(x) + n(x)$ and $f(-x)=n(x)-m(x)$.

-
sorry but would this be as simple as m(x)= f(x)-n(x) and n(x)=f(-x)+m(x) ? –  xiA May 30 '13 at 14:30
No, add the two equations. $m(x)$ will cancel and you can simplify to express $n(x)$ in terms of $f(x)$ and $f(-x)$. Then, subtract to do the same for $m(x)$. –  response May 30 '13 at 14:32
Brilliant thanks, It had been a while since I'd used the old elimination method. –  xiA May 30 '13 at 14:42