Brian Earthrowl wrote: On seeing an expression of the form ln(x+a)^2 I would assume that to evaluate it (x+a) is first squared and then the log of the result is found. I was surprised to find that in Mathcad the log is evaluated first and then the result is squared. This seems to apply to other functions. It took me a while to figure out this as the cause of the error in some calculations. Has anyone else been caught out by this or am I being naive? |
If you choose a function from the function menu you will notice that in all cases it is inserted into the worksheet with a name and a pair of brackets, thus: ln(#) or sin(#) or mod(#,#) ...etc. (where the # is a rectangular black placeholder in Mathcad). Thus the function includes the brackets, so ln(#)^2 raises the whole function to the power 2. This also holds if you type the function in by hand. You need to write ln((x+a)^2) if you want to square the argument before activating the function.
Alan