# How to set HeavisideTheta[0] to 1 permanently

I always meet the HeavisideTheta[0] = 1 during my work, every time I need to use the function Replace[] to finish the job, which has been harassing me. So I want to know if there's a method to set HeavisideTheta[0] = 1 permanently, or copy the definition of HeavisideTheta to a new file and rewrite it to a new package(.m or .wl file) meeting my will. In the post Add a global rule for HeavisideTheta[0], Mauricio Fernández proposed a global assumption method, but it is not convenient because I have to call the Simplify everytime. Thank you!

• Have you tried Unprotect[HeavisideTheta], HeavisideTheta[0]=1, Protect[HeavisideTheta] as suggested in one of the comments in the linked question? That would be the usual way to do this, if you had to. Beware that it might break things, though. – Carl Lange Apr 17 at 9:48
• The question arises: what for? – user64494 Apr 17 at 9:50
• Maybe use UnitStep instead? – Chip Hurst Apr 17 at 12:34
• @user64494 @Chip Hurst, I use the HeavisideTheta to control boundary condition during symbolic formula derivation and the final numerical calculation, which involving Heaviside's derivative and HeavisideTheta[0], so Unitstep doesn't meet the situation. – likehust Apr 17 at 15:19
• @Carl Lange, thanks, the method you talked about is feasible, can you tell me how to write this code fragment into init.m file and make every .nb file load them automatically every time? – likehust Apr 17 at 15:30

As discussed in the comments, you can set this by Unprotecting the symbol, like so:
Unprotect[HeavisideTheta]

Note that this may cause some issues with functions that expect HeavisideTheta[0] to be 0.
• Thank you, I have taken your solution, write Unprotect[HeavisideTheta]; HeavisideTheta[0]=1;HeavisideTheta[0.0]=1; Protect[HeavisideTheta]; into the init.m in the directory of C:\ProgramData\Mathematica\Kernel, and realized what I wanted. – likehust Apr 18 at 7:43