Prove that (f+g)(x) is an odd function, if f and g are odd functions (Stewart, Calculus)

Suppose f(x) and g(x) are odd functions. Prove that (f+g)(x) is also an odd function.  Answer:  1. Strategy By definition, f is an odd function if and only if f(-x) = - f(x) To show (f+g) is an odd function, we need to show (f+g)(-x) = - (f+g)(x) 2. Explanation Since $f(x)$ and $g(x)$ are odd functions $\Rightarrow f(-x) =-f(x)$ and $g(-x) =-g(x)$ By definition of sum of functions. $(f+g)(-x) =f(-x)+g(-x)$ $=-f(x)-g(x)$ $=-(f(x)+g(x))$ $=-(f+g)(x)$ (by definition of sum of functions) $\Rightarrow(f+g)(-x) =-(f+g)(x)$ $\Rightarrow f+g$ is an odd function. Q.E.D. 

[Python] Answers to: Why error messages are shown a line-by-line way? Why not shown as a block of codes?

It would be nice if errors in a program are shown at once.  Unfortunately, (I think) Python's error outputs are structured so that a line by line error messages are shown. 

 

I think the "one-by-one" error message is shown because we are using Python as the programing language. Because 1) Python is an 'interpreter' language, 2) an interpreter language translates a code line by line into a machine language, 3) a machine executes a line by line, 4) when a line contains an error, then the machine stops executing and presents an error message. 

 

I also think the youtube video below helps how an interpreter language (like Python) presents an error message (https://www.youtube.com/watch?v=3iLUls6Z_tw- title: compiler vs interpreter) 

 

Comments

Popular posts from this blog

Prove that (f+g)(x) is an odd function, if f and g are odd functions (Stewart, Calculus)

[Math] A proof of Triangle Inequality (1)

[Python] Sublime Text: set a build on Python 2.7 creating a sublime-build file (solution to WinError 2 problem)