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 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$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.