Forum Discussion

pwlbwnski's avatar
pwlbwnski
Copper Contributor
Nov 25, 2026

How should a formula look for y=(-x^2 * e^-x) - 0,2 ?

The task was to create a formula for x between (0;10>. X was supposed to be in the column A, i input 0,1 for A1, 0,2 for A2 and so on. My formula in column B was =(-(A1^2)*exp(-A1))-0,2 according to my teacher that is incorrect. She insists that it should be =(-A1*exp(-A1))-0,2. Any other app shows the graph for this fuction going under the x axis and having a ,,dip". My teacher says it should be crossing the x axis in two spots and having a ,,hill" shape. Who is correct, and how to explain that?

 

2 Replies

  • Neither your teacher nor you are right... if we consider the technical details and mathematical rules.

     Assuming x is in cell A1, the Excel formula is:

    =-A1^2 * EXP(-A1) - 0,2

    A few things to keep in mind in Excel:

    Order of operations: In Excel, exponentiation (^) is evaluated before multiplication (*), which is evaluated before subtraction (-). Leading -A1^2 evaluates A1^2 first and negates it, then multiplies by EXP(-A1) and subtracts 0.2. So the outer parentheses are redundant and not needed.

    Euler's number (e): Use EXP(z) to calculate e^z.

    Decimal separator: This uses a dot (0.2) for English/US regional settings; if your system uses a comma as the decimal separator, use 0,2 instead.

    Value range / plotting: For negative x values, EXP(-A1) grows quickly while -A1^2 is always less than or equal to 0, so the result drops sharply (around x less than -0.4), whereas for larger positive x values it approaches -0.2. For a table or chart, a range like -1 to 5 in steps of 0.1 works well.

    Andreas.

     

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    pwlbwnski​ Well, I'm no mathematician but it all depends on what -x^2 is supposed to calculate.

    In Excel, -(x^2) will return the negative of a squared number (i.e. always negative) whereas -x^2 returns the square of a negative number (i.e. always positive).