ρ := 0.2
m := 1
k := 1
ξ := 0.1
r[x_] := 
      0 /; 0 ≤ x ≤  
          2  π
r[x_] := ((E^(-(((-2 π + x) (ξ + 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) ρ ((k + m) (ξ + 
                        2 ρ) - (E^((((-2 π + x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/m))) (k + 
                        m) (ξ + 2 ρ) - 
                  k (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) - (E^((((-2 π + x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/m))) k (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) + 
                  m (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) + (E^((((-2 π + x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/m))) m (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) + 
                  2 (E^(-(((2 π - x) (ξ + 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) ((k - m) Cos[
                            x] + (ξ + 2 ρ) Sin[
                            x])))/(2 ((((k - m))^2) + (((ξ + 2 ρ))^2)) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])) /; 
        2  π < x ≤ 3  π
r[x_] := (ρ ((E^(-(((2 π - x) (-ξ - 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) (m (-ξ - 
                              2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])) - k (ξ + 
                              2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))) + (E^(-(((3 π - x) (-ξ - 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) (m (-ξ - 
                              2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])) - k (ξ + 
                              2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))) + (E^((((2 π - x) (ξ + 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) (k (ξ + 
                              2 ρ - (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])) + m (ξ + 
                              2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))) + (E^((((3 π - x) (ξ + 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) (k (ξ + 
                              2 ρ - (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])) + m (ξ + 
                              2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))))/(2 ((((k - m))^2) + (((ξ + 2 ρ))^2)) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])) /; 
        3  π < x
Plot[r[x], {x, 0, 20}, PlotRange ->  All]

ρ := 0.2
m := 1
k := 1
ξ := 0.1
r[x_] := (ρ (2 ((E^((((3 π - x) (ξ + 2 ρ))/(2 m)))) (-k + 
                            m) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) Cosh[(((3 π - x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/(2 m))] - (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) ((k - m) Cos[x] + (ξ + 2 ρ) Sin[
                                x]) + (E^((((3 π - x) (ξ + 2 ρ))/(2 m)))) (k + m) (ξ + 
                            2 ρ) Sinh[(((3 π - x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/(2 m))]) UnitStep[-3 π + x] + (E^(-(((-2 π + x) (ξ + 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) ((k + m) (ξ + 
                            2 ρ) - (E^((((-2 π + x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/m))) (k + 
                            m) (ξ + 2 ρ) - 
                      k (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) - (E^((((-2 π + x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/m))) k (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) + 
                      m (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) + (E^((((-2 π + x) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))/m))) m (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) + 
                      2 (E^((((-2 π + x) (ξ + 2 ρ + (Sqrt[-4 k m + (((ξ + 2 ρ))^2)])))/(2 m)))) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]) ((k - m) Cos[
                                x] + (ξ + 2 ρ) Sin[
                                x])) UnitStep[-2 π + 
                      x]))/(2 ((((k - m))^2) + (((ξ + 2 ρ))^2)) (Sqrt[-4 k m + (((ξ + 2 ρ))^2)]))
Plot[r[x], {x, 0, 20}, 
      PlotRange ->  All]