title: I don't understand the (very simple) mathematics behind this (broader topic = lambdas/functions)
body: <p>this is the topic matter that is the context of my question:</p>
  <pre><code>#named function
  def polynomial(x):
      return x**2 + 5*x + 4
  print(polynomial(-4))
  
  #lambda
  print((lambda x: x**2 + 5*x + 4) (-4))
  </code></pre>
  <p>Now, the answer to this is 0 and I could just continue if I wanted, but I always want to understand the mathematics behind these things. When I do this simple calculation, my answer is -32 and not 0. I have written down a bunch of things in Pycharm:</p>
  <pre><code>print((-4) ** 2 + (-4) * 5 +4)
  print(-4 ** 2 + -4 * 5 +4)
  print((lambda x: x**2 + 5*x + 4) (-4))
  print(4 ** 2 + 4 * 5 +4)
  print((4 ** 2) + (4 * 5) +4)
  print(-16 + -20)
  print((-16) + (-20))
  print((-16 - -20 ) - 4 )
  </code></pre>
  <p>based on the following topic (just the reply): <a href="https://www.sololearn.com/Discuss/376196/named-function-def-polynomial-x-return-x-2-5-x-4-print-polynomial-4-lambda-print-lambda-x-x-2-5-x-4" rel="nofollow noreferrer">https://www.sololearn.com/Discuss/376196/named-function-def-polynomial-x-return-x-2-5-x-4-print-polynomial-4-lambda-print-lambda-x-x-2-5-x-4</a></p>
  <p>and the answers are:</p>
  <pre><code>0
  -32
  0
  40
  40
  -36
  -36
  0
  </code></pre>
  <p><strong>In summary: I don't understand what happens exactly because the argument is a negative value mathematics-wise. Again, the Python just does the job for me but I want to understand what happens because I cannot reproduce it, and when I try it on my own I get -32 as an answer, because in my manual calculation, it would be (-4 tothepowerof 2 = -16)  +  (5 * -4 = -20) + 4 = -32</strong></p>