2
$\begingroup$

This question already has an answer here:

I used free-from input to do this:

= integrate sec x with respect to x

I got a huge amount of information, but I'd like to focus on this plot that was given:

enter image description here

Can my colleagues show how to do this plot?

It's also interesting that Mathematica gives this answer:

In[91]:= Integrate[Sec[x], x]

Out[91]= -Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]]

But if we click on Step-by-step-solutions, Wolfram Alpha gives this answer:

enter image description here

Which is similar to the hand-calculated solution

$$\ln|\sec x+\tan x|+C$$

found by students in Calculus II.

$\endgroup$

marked as duplicate by Michael E2 plotting Jan 3 '17 at 1:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4
$\begingroup$

It depends on the CAS system. $\int \sec(t) \, dt$ gives

Mathematica:     ln(cos(t/2)+sin(t/2))-ln(cos(t/2)-sin(t/2))
Wolfram/ALpha:   ln(tan(t)+sec(t))+ constant
Rubi:            arctanh(sin(t))
Fricas:          1/2 ( ln(1+sin(t)) - ln(1-sin(t)) )
Maple            ln(sec(t)+tan(t))
Derive 6.10      LN(TAN((2*t + pi)/4))
Maxima           log((1+sin(x))/cos(x))

As for your plot, you can do

expr = Log[Sec[x] + Tan[x]];
Plot[{Re@expr, Im@expr}, {x, -2 Pi, 2 Pi}, PlotStyle -> {Blue, Red}, 
    PlotLegends -> {"real part", "imaginary part"}, 
    PlotLabel -> TraditionalForm[expr]]

Mathematica graphics

reference: sci.math.symbolic

$\endgroup$
  • $\begingroup$ Really nice answer. I learned a lot from your help. Thanks. $\endgroup$ – David Jan 2 '17 at 23:45

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