0
$\begingroup$

Let's say I've the following function (that is also periodic over the rest of the region I did not define):

$$ \begin{cases} 4\sin\left(2x\right)\space\space\space\space\space\space\space\space\space\text{when}\space0\le x<\pi\\ \\ 4\exp\left(-2x\right)\space\space\space\space\space\text{when}\space\pi\le x<2\pi \end{cases}\tag1 $$

So, after $2\pi$ the sine part of the function start again. How can I plot that function in Mathematica 10.0?

$\endgroup$
2
  • 1
    $\begingroup$ Use Piecewise[{{4 Sin[2 x], Mod[x, 2 Pi] < Pi}}, 4 Exp[-2]]. $\endgroup$ Commented Jan 29, 2018 at 17:49
  • $\begingroup$ Closely related Can I limit PlotRange for 1 function in a Plot? $\endgroup$ Commented Jan 29, 2018 at 18:10

1 Answer 1

0
$\begingroup$

Your function is a bit bizarre, so I have modified it a bit to show its periodicity better:

Piecewise[{{Sin[x], Mod[x, 2 Pi] < \[Pi]}}, -Abs@Cos[x]] 

enter image description here

Plot[Piecewise[{{Sin[x], Mod[x, 2 Pi] < \[Pi]}}, -Abs@Cos[x]], {x, -8, 8}] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.