Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Laplace Transform of tan(t)

  1. Aug 11, 2011 #1


    User Avatar
    Gold Member

    EDIT: I think all errors are fixed now. It's 1:30 AM and I'm going to bed now.


    I am trying to find the Laplace transform of tan(t), but I don't know if I'm getting anywhere. I can't find it in Laplace transform tables and WolframAlpha gives me an answer in terms of complex numbers, hyperbolic trig functions and the digamma function and I don't understand how they get that.

    Here is my working and how I got to where I am currently;

    [tex]\mathcal{L}\{{\tan}t\} = \int_{0}^{\infty}e^{-st}{\tan}tdt[/tex]

    Because by integrating tan(t) I had the feeling I would end up with increasingly complicated integrations if I integrated by parts multiple times so I wrote it as the integral of three functions;


    Because this is the product of 3 functions I derived what the formula for integration by parts using the product rule like this;

    [tex]\frac{d}{dt}uvw = w(udv + vdu) + uvdw[/tex]

    Integrating both sides;

    [tex]uvw = \int uwdv - \int vwdu - \int uvdw[/tex]


    [tex]\int uvdw = uvw - \int uwdv - \int vwdu[/tex]

    where u, v, w are all functions of t.

    For integration by parts I let;

    [itex]u = \frac{1}{{\cos}t}[/itex] so [itex]du = \frac{{\sin}t}{{\cos}^{2}t}dt[/itex]

    [itex]v = {\sin}t[/itex] so [itex]dv = {\cos}tdt[/itex]

    [itex]dw = e^{-st}dt[/itex] so [itex]w = -\frac{1}{s}e^{-st}[/itex]

    Using our formula for integration by parts we get;

    [tex]-\frac{1}{s}e^{-st}{\sin}t\frac{1}{{\cos}t} - \int_{0}^{\infty}-\frac{1}{s}e^{-st}\frac{1}{{\cos}t}{{\cos}t}dt - \int_{0}^{\infty}-\frac{1}{s}e^{-st}\frac{{\sin}^{2}t}{{\cos}^{2}t}dt[/tex]


    [tex]-\frac{1}{s}e^{-st}{\tan}t + \frac{1}{s}\mathcal{L}\{1\} + \frac{1}{s}\mathcal{L}\{{\tan}^{2}t\}[/tex]

    Laplace transform of 1 is just [itex]\frac{1}{s}[/itex], so;

    [tex]-\frac{1}{s}e^{-st}{\tan}t + \frac{1}{s^{2}} + \frac{1}{s}\int_{0}^{\infty}e^{-st}{\tan}^{2}tdt[/tex]

    Doing integration by parts again, I rewrite the integral as [itex]\int_{0}^{\infty}e^{-st}{\sin}^{2}t\frac{1}{{\cos}^{2}t}dt[/itex].

    I let;

    [itex]u_{2} = \frac{1}{{\cos}^{2}t}[/itex] so [itex]du_{2} = \frac{{\sin}2t}{{\cos}^{4}t}dt[/itex]

    [itex]v_{2} = {\sin}^{2}t[/itex] so [itex]dv_{2} = {\sin}2tdt[/itex]

    [itex]dw_{2} = e^{-st}dt[/itex] so [itex]w_{2} = -\frac{1}{s}e^{-st}[/itex]

    Using our formula for integration by parts again we get;

    [tex]\mathcal{L}\{{\tan}t\} = -\frac{1}{s}e^{-st}{\tan}t + \frac{1}{s^{2}} + \frac{1}{s}\bigg(-\frac{1}{s}e^{-st}\frac{1}{{\cos}^{2}t}{\sin}^{2}t - \int_{0}^{\infty}-\frac{1}{s}e^{-st}\frac{1}{{\cos}^{2}t}{\sin}2tdt - \int_{0}^{\infty}-\frac{1}{s}e^{-st}\frac{{\sin}2t}{{\cos}^{4}t}{\sin}^{2}tdt\bigg)[/tex]


    [tex]\mathcal{L}\{{\tan}t\} = -\frac{1}{s}e^{-st}{\tan}t + \frac{1}{s^{2}} + \frac{1}{s}\bigg(-\frac{1}{s}e^{-st}{\tan}^{2}t + \frac{2}{s}\mathcal{L}\{{\tan}t\} + \frac{2}{s}\mathcal{L}\{{\tan}^{3}t\}\bigg)[/tex]

    So as you can see I end up with a tan(t) cubed term to take the Laplace transform of which looks worrying as it looks like no matter how many Laplace transforms I take I'll still end up with some power of tan(t) to take the Laplace transform of, which gets me nowhere. I was wondering if anyone could help me provide a better method of doing this as I think I'll be doing integration by parts forever.

    Last edited: Aug 12, 2011
  2. jcsd
  3. Aug 11, 2011 #2
    Does the first integral converge? If not, the symbol means nothing.
  4. Aug 11, 2011 #3


    User Avatar
    Gold Member


    Now that I think about it I don't think it does converge... looks like I wasted my time then.
  5. Aug 12, 2011 #4


    User Avatar
    Gold Member

    This is what Wolfram Alpha says (credit to Au101 from mathsisfunforum.com for typing this up):

    [tex]\mathcal{L}_{t}[\tan(t)](s) = -\frac{i}{s} - \frac{1}{2}i\pi
    \operatorname{csch}\left(\frac{\pi s}{2}\right) - \frac{1}{2}\psi\left(
    \frac{1}{2} + \frac{is}{4}\right) + \frac{\psi\left(\dfrac{is}{4}\right)
    [tex]\text{For: } \mathcal{L}_{t}[\tan(t)](s) = \mathcal{P}\int_{0}^{
    \infty} e^{-st}\tan(t) \; dt \text{ and } \Re(s) > 0[/tex]
    [tex]\mathcal{L}_{t}[f(t)](s) \text{ is the Laplace transform of } f(t)
    \text{ with complex argument } s[/tex]
    [tex]\operatorname{csch}(x) \text{ is the hyperbolic cosecant function}[/tex]
    [tex]\psi^{(n)}(x) \text{ is the } n^{\text{th}} \text{ derivative of the
    digamma function}[/tex]
    [tex]\mathcal{P}\int f \; dx \text{ is the Cauchy principal value integral}[/tex]
    [tex]\Re(z) \text{ is the real part of } z[/tex]

    I don't understand how they got that though?
  6. Aug 12, 2011 #5
    Let me start by saying I've never seen a Cauchy principal value integral. All my comments are from a few minutes of research.

    The Cauchy principal value integral is essentially a method of assigning mathematically useful values to divergent improper integrals. Wikipedia, for instance, defines the Laplace transform in terms of a Lebesgue integral. The key point really is that the Lebesgue and the Cauchy principle value are *not* the same, so in the traditional sense, what Wolfram|Alpha computed is not actually the Laplace transform of the tangent, which doesn't exist, because the Lebesgue integral diverges. However, (it is likely that - again, I've never seen this integral before) the function Wolfram computed has many of the useful properties of the Laplace Transform, and is therefore a reasonable substitute.
  7. Aug 12, 2011 #6


    User Avatar
    Gold Member


    Thanks for the info. So you are saying that the output Wolfram|Alpha gives is computing something entirely different?

    I have been trying to make sense of the Wikipedia article of the Cauchy principal value. Would I be correct in saying that one can change a divergent improper integral to a convergent improper integral by applying a Cauchy principal value to it? I can't find out how this works, nor how W|A gives the output that it does. I'm currently trying to integrate using the definition of tan(t) in terms of e and i, and on another forum someone did it using a series expansion of tan(t) and then integrating.

    So does there exist no Laplace transform for any non-piecewise continuous function?
  8. Sep 25, 2013 #7
    tangent Laplace transform

    Please read the Penn State Erie MATH 251 Laplace Transforms PDF (page 133).
  9. Sep 25, 2013 #8
    No, not at all. Don't you know the road to the right one is often strewn with wrong ones and sometimes the only way to get to the right one is to wade through those wrong ones.

    Principal-valued integrals are very important and solve a wide variety of problems. Do you know Riemann relied on these types of integrals to construct his expression for counting primes? If he can do it, how come we can't?

    What would you do if your teacher just wrote on the board

    [tex]\mathcal{L} \tan(x)[/tex]

    and said, "make is so" and dismissed class? No you can't drop-add. Too late. How can I make converge, the integral:

    [tex]\int_0^{\infty} e^{-st} \tan(t)dt[/tex]

    I'm not proud. How about just

    [tex]\int_0^{\infty} e^{-2t} \tan(t)dt[/tex]

    What does the integrand look like? Well it has asymptotes at [itex]\pi/2, 3\pi/2,5\pi/2,\cdots[/itex].

    Still not proud. How about just then:

    [tex]\int_0^{\pi} e^{-2t}\tan(t)dt[/tex]

    and since I need this class, I want to make it so. Well, in that case I can take the principal-valued integral:

    [tex]\text{PV}\int_0^{\pi} e^{-2t}\tan(t)dt[/tex]

    and that integral converges in the principal-valued sense. Which you can look up if you want. Same dif for

    [tex]\text{PV}\int_\pi^{2\pi} e^{-2t}\tan(t)dt[/tex]

    and in fact:

    [tex]\lim_{N\to\infty} \sum_{n=0}^N \left\{\text{PV}\int_{n\pi}^{(n+1)\pi} e^{-2t}\tan(t)dt\right\}[/tex]

    converges as well so that I can say:


    converges. In fact, it converges very quickly. We can compute say the first five terms and then compare it to the digamma expression Mathematica returns:

    Code (Text):

    myf[s_] := -I/s - (1/2)*Pi*I*Csch[Pi*(s/2)] - (1/2)*PolyGamma[1/2 + I*(s/4)] +
    mysum = Sum[NIntegrate[Exp[-2*t]*Tan[t], {t, k*Pi, k*Pi + Pi/2, (k + 1)*Pi},
        Method -> "PrincipalValue"], {k, 0, 5}]

    Out[20]= 0.269611 - 1.11022*10^-16 I

    Out[21]= 0.269611
    We can then write:

    \mathcal{L}_{t}[\tan(t)](s)\biggr|_{s=2} &= \lim_{N\to\infty} \sum_{n=0}^N \left\{\text{PV}\int_{n\pi}^{(n+1)\pi} e^{-2t}\tan(t)dt\right\}\\
    &=\left( -\frac{i}{s} - \frac{1}{2}i\pi
    \operatorname{csch}\left(\frac{\pi s}{2}\right) - \frac{1}{2}\psi\left(
    \frac{1}{2} + \frac{is}{4}\right) + \frac{\psi\left(\dfrac{is}{4}\right)

    Could someone figure out how that limit equals that for us please and write it up nicely in Latex?

    What about other values of s then?
    Last edited: Sep 25, 2013
  10. Sep 27, 2013 #9
    Let [itex]T(s)=-i/s-\pi/2 \text{csch}(\pi s/2)-1/2\psi(1/2+is/2)+1/2 \psi(is/4)[/itex], and consider

    [tex]\mathop\oint\limits_{\text{box}} e^{st} T(s)ds[/tex]

    where the right side of the box is pinned on the Bromwich contour of what would be the inverse transform integral. Let the horizontal legs pass between consecutive poles at [itex]\pm 2ni[/itex] and [itex]\pm 2(n+1)i[/itex] for [itex]n[/itex] a positive number. The integral over the Bromwich leg can be expressed as a sum of residues and the two integrals over the horizontal legs:

    [tex]\frac{1}{2\pi i} \mathop\int\limits_{\sigma-iT}^{\sigma+iT} e^{st} T(s)ds=2\sum_{k=1}^{K} (-1)^{k+1} \sin(2kt)-\frac{1}{\pi} \text{Im}\left\{\int_{\sigma}^{-\infty} e^{st}T(s)ds\right\}[/tex]

    Let [itex]\sigma=1[/itex] and create a table of points [itex](t,\tan(t))[/itex] equally spaced in the interval [itex](0,2\pi)[/itex] and avoiding [itex]\pi/2[/itex]. Compute the above expression for each value of [itex]t[/itex] in this list for [itex]K[/itex] in the range of 10 to 800.

    Take the mean value of the list for each value of [itex]t[/itex] and superimpose it over the tan function. The first plot shows the actual points choosen over the tan function. The second plot shows the results of this mean-value analysis.

    The results look interesting. However, I'm not suggesting the transform and inverse transform integrals for the tangent function are valid. I'm simply showing that the Bromwich integral data, if averaged, does appear to be tending to the tangent function.

    Attached Files:

    Last edited by a moderator: Sep 28, 2013
  11. Sep 29, 2013 #10
    Now consider the initial value problem

    [tex]y''+y'=\tan(t),\quad y(0)=0, \quad y'(0)=1[/tex]

    Let's apply the mean-value transform described above to this problem. We can first solve the equation numerically in the interval [itex](0,3/2)[/itex], the solution of which is shown in the first plot below.

    Then attempting to take this transform of both sides, we obtain


    where [itex]T(s)[/itex] is the tangent transform described above and [itex]Y(s)[/itex], the transform of the solution. In a likewise manner of what was done in the previous post, we consider the Bromwich integral:

    [tex]y(t)=\frac{1}{2\pi i}\mathop\int_{\sigma-i\infty}^{\sigma+i\infty} e^{st}\frac{T(s)+1}{s^2+s} ds[/tex]

    and doing the same analysis as above, we can estimate this integral as a sum of residues and integrals over a (finite) square contour pinned at the Bromwich leg:

    [tex]y(t)=B+\sum_{k=1}^K (-1)^{k+1} 2\text{Im}\left(\frac{1}{(2ki)^2+2ki}\right) (\cos(2kt)+2k\sin(2kt))-\frac{1}{\pi}\text{Im}\left\{\int_{\sigma}^{-\infty} e^{st} \frac{T(s)+1}{s^2+s}ds\right\}[/tex]

    where [itex]B[/itex] is the sum of the residues at the points zero and minus one and the other sum, the enclosed residues at the points [itex]-2ki[/itex] and [itex]2ki[/itex].

    Evaluating this expression for a set of points in the interval [itex][0,3/2][/itex] and taking the mean over 160 terms, we then superimpose the results along the numerical solution of the IVP, and obtain the second plot below.

    The results are again encouraging. Based on the results of this study, I propose considering the mean-value integrals described above, potential valid definitions for [itex]\mathcal{L}\{\tan(t)\}[/itex] and [itex]\mathcal{L}^{-1}\{T(s)\}[/itex].

    Attached Files:

    Last edited: Sep 29, 2013
  12. Sep 29, 2013 #11
    Hello !

    Since the Laplace transform of tanh(x) is wellknown, it seems an easy way to start with (Attachment)
    The Principal Value is for the real part only. It would be difficult to analytically express the imaginary part. In fact we don't need to do it : we know that PV is real, so the imaginary part is = 0.
    This is consistent with the complete formula reported by Jackmell at the end of the post Sep25-13 01:48 PM , if we take the real part only.

    Attached Files:

    Last edited: Sep 29, 2013
  13. Sep 30, 2013 #12
    Hi JJacquelin,

    Got some problems with your analysis above:

    For example, suppose we let a=2 and s=2 and consider:

    [tex]\int_0^\infty e^{-2t} \tanh(2t)dt[/tex]

    Numerically, that's 0.2854.

    However, using your formula:

    [tex]\frac{1}{2 a} \psi_0\left(\frac{a s+2}{4}\right)-\frac{1}{2 a} \psi_0\left(\frac{a s}{4}\right)-\frac{1}{a^2 s}[/tex]

    I get 0.0284.

    However, when I integrate the expression in Mathematica, I get

    [tex]\int_0^{\infty} e^{-st} \tanh(at)dt=\frac{-2 a-s \text{PolyGamma}\left[0,\frac{s}{4 a}\right]+s \text{PolyGamma}\left[0,\frac{1}{4} \left(2+\frac{s}{a}\right)\right]}{2 a s}[/tex]

    and when I substitute a=2 and s=2 into that expression, I obtain the correct answer. However, Mathematics says that antiderivative is valid only when Re(a)>0 and Re(s)>0. So if that is the case, we cannot make the substitution a=i and then conclude the resulting expression is the integral for the tangent function.
  14. Oct 1, 2013 #13
    Hi Jackmell !

    you are right. Thank you for pointing out the mistake.
    In fact, I made a wrong copy of the formula because I had to change the symbols in order to made them correspond with the notations used here. The stupid mistake was to confuse s/a with s*a.
    The corrected page is attached below.
    By chance, the final result isn't changed : since a=i, confusing s/i with s*i only change the sign of i*s. And changing i into -i in the digamma functions change the imaginary part, but not the real part.
    Mathematica is right in saying that the antiderivative is valid only when Re(a)>0 and Re(s)>0. This is true if we consider the whole complex expression because the imaginary part would not be correct. But, if we consider the real part only, the restrinction is only Re(s)>0.

    Attached Files:

  15. Oct 1, 2013 #14

    I don't understand why you're saying the principal-valued integral of the tangent transform is real. I understand it would be real for real s and I checked your formula for that, but we can't restrict s to the reals since we intend to integrate the transform over the complex plane to invert it and for example:

    [tex]\text{PV}\int_0^{\infty}e^{-(1+i)t} \tan(t)dt\approx. 0.5-0.351i[/tex]
  16. Oct 1, 2013 #15
    all I said, since the begining of the discussion, is for s real and s>0.
    The starting point of the topic was about Laplace transform. So, I suppose that the question raised by FeDeX_LaTeX is with s real.
    Of course, if s is not real, the simplified method that I proposed is not valid.
  17. Oct 1, 2013 #16
    Ok, I didn't understand that. I'm clear now. Thanks.

    I'm still working on:

    [tex] \lim_{N\to\infty} \sum_{n=0}^N \left\{\text{PV}\int_{n\pi}^{(n+1)\pi} e^{-st}\tan(t)dt\right\}=\left( -\frac{i}{s} - \frac{1}{2}i\pi
    \operatorname{csch}\left(\frac{\pi s}{2}\right) - \frac{1}{2}\psi\left(
    \frac{1}{2} + \frac{is}{4}\right) + \frac{\psi\left(\dfrac{is}{4}\right)

    I'm pretty confident I can figure it out by the end of the year though. This whole principal-valued transform idea is a really beautiful problem for me. :)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook