# Error: Tag Piecewise is protected

**URL:** <https://community.wolfram.com/t/error-tag-piecewise-is-protected/18134>\
**Category:** Questions\
**Created:** [May 20, 2021, 3:29pm UTC](https://community.wolfram.com/t/error-tag-piecewise-is-protected/18134 "2021-05-20T15:29:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubens951jti](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@rubens951jti](https://community.wolfram.com/u/rubens951jti)\
**Post date:** [May 20, 2021, 3:29pm UTC](https://community.wolfram.com/t/error-tag-piecewise-is-protected/18134/1 "2021-05-20T15:29:24Z")

</div>

When I Enter the following code, Mathematica returns "Tag piecewise in (piecewise function) [x\_] is protected, and when I plot this, the mid piece does not appears, someone can tell me where is the error of my code?

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/abdad727-1140-47be-8c8b-3a5e957d9d2b)

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [May 20, 2021, 4:29pm UTC](https://community.wolfram.com/t/error-tag-piecewise-is-protected/18134/2 "2021-05-20T16:29:58Z")

</div>

Hi Rubens,

Most likely you have a conflicting definition for `Subscript[\[Psi], 1][x_]`. Try

```
Remove[\[Psi]]

```

And use `SetDelayed` in the definition, `:=`, not `=`.

---

<div class="post-metadata">

**Author:** ![rubens951jti](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@rubens951jti](https://community.wolfram.com/u/rubens951jti)\
**Post date:** [May 20, 2021, 4:42pm UTC](https://community.wolfram.com/t/error-tag-piecewise-is-protected/18134/3 "2021-05-20T16:42:50Z")

</div>

Hi Rohit, thank you. The error has been fixed but the mid piece dont appears on my graph, do you know tell me why?

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [May 20, 2021, 5:02pm UTC](https://community.wolfram.com/t/error-tag-piecewise-is-protected/18134/4 "2021-05-20T17:02:42Z")

</div>

Add `PlotRange -> All` or reduce the `x` range

```
Plot[Piecewise[
         {{5.66048 E^(0.76` x), x < -5}, 
          {0.398447 Cos[0.25 x], -5 <= x <= 5}, 
          {5.66048 E^(-0.76` x), x > 5}}, 0],
   {x, -10, 10}]

```

 ![7512plot.png](https://global.discourse-cdn.com/wolfram/original/3X/a/8/a8e341c78688e2c1048985aea417b2bfdeaaaaf0.png)

```
LogPlot[Piecewise[
         {{5.66048 E^(0.76` x), x < -5}, 
          {0.398447 Cos[0.25 x], -5 <= x <= 5}, 
          {5.66048 E^(-0.76` x), x > 5}}, 0],
   {x, -10, 10}]

```

 ![3396plot.png](https://global.discourse-cdn.com/wolfram/original/3X/5/7/577c97c483626c6960c5b9e8eba581e6c22bf8df.png)
