1
$\begingroup$

I have a recursion relation defined as

Clear[f];
f[x_] := 0 /; 0 <= x < π/3;
f[x_] := x - π/3 /; π/3 <= x < 2 π/3;
f[x_] := f[x - 2 π/3] + π/3 /; x >= 2 π/3;
f[x_] := -f[π/3 - x] /; x < 0;

Plot[f[x], {x,-2Pi,2Pi}, Ticks->{Range[-2π,2π,π/2], Automatic}]

enter image description here

I'm unsure of where to go from here to find the solution. RSolve seems doesn't worked.

How to use Mathematica to find it?

$\endgroup$
  • 3
    $\begingroup$ Maybe h[x_] := Max[Mod[x, 2/3 \[Pi]] - \[Pi]/3, 0] + Quotient[x, 2/3 \[Pi]] \[Pi]/3 ? $\endgroup$ – b.gates.you.know.what Jan 9 '18 at 8:16
  • 1
    $\begingroup$ ... Is this a math question or a Mathematica question? The answers here give "the mathematical result", not "how to use Mathematica to find it". $\endgroup$ – user202729 Jan 9 '18 at 9:51
3
$\begingroup$
f2[x_] := If[EvenQ[#], # π/6, (# - 1) π /6 + #2] & @@ QuotientRemainder[x, π/3];

Plot[{f2[x], f[x]}, {x, -2 π, 2 π}, 
 Ticks -> {Range[-2 π, 2 π, π/3], Automatic},  
 PlotStyle -> {Directive[Opacity[.7], Thickness[.01], Red], 
   Directive[Black, Dashed]}, PlotLegends -> "Expressions"]

enter image description here

$\endgroup$
  • $\begingroup$ Yes... but how did you find this function? $\endgroup$ – David G. Stork Jan 10 '18 at 1:03
  • $\begingroup$ @DavidG.Stork, by squinting (really hard, unfortunately):) $\endgroup$ – kglr Jan 10 '18 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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