# How to sum over the variable in partial derivative operator?

I need to use the partial derivative operator in Wolfram Mathematica within a summation, specifically to define the D'Alembertian operator of scalar fields. I am having trouble summing over the D operator.

This is how I have defined the function currently and this is giving me an error. Edit : I made the suggested change of parenthesis and it solves the error. But I would appreciate any help in solving the summation issue, ie, to sum the two derivative operators over the 4 co-ordinates.

• You're using square brackets ([...]) after the partial derivative operator instead of parentheses ((...)). In Mathematica, expressions can only be grouped using parentheses. Square brackets are reserved for function calls – Lukas Lang Jan 9 '19 at 14:43
• – Bob Hanlon Jan 9 '19 at 16:57
• @LukasLang, using parentheses instead of square brackets has helped me obtain an output. Thank you! But I realize that my approach of summing over k and l is not giving me the intended result. What I intended is to take partial derivatives with respect to 3 space coordinates and 1 time coordinate. I used k and l hoping to run over these 4 coordinates, but that is not happening. Please give some suggestions on how to do this! – mv1996 Jan 9 '19 at 18:06
• @BobHanlon I appreciate the info, since I am just beginning to use Mathematica. Thank you :) – mv1996 Jan 9 '19 at 18:07
• @mv1996, hi, may i ask in your question , you first said you take the D'Alembertian operator of scalar fields, then in the code you have taken D for a second rank tensor, is not a scalar is a first rank tensor. Also in the Edit you said , you need help to sum the two derivative operators over the 4 co-ordinates, however i notice in your code , you have done already . If you tell me about this please, cause i have also D operator for a scalar field z : $\partial_\mu \partial^\mu z$ want to interpret in MA. – S.S. Sep 22 '19 at 16:31