3

$$\int_{x=0}^\tau \frac{1}{\|[\cos x,\sin x]-\vec{p}\|^n}$$ where $n$ is either $1$ or $2$ and $\vec{p}$ is a part of $\Bbb{R}^2$. Is there a way to simplify this into something that is much quicker for a computer to calculate or is the best option to just make a "map" of all of the distances $\vec{p}$ could be from the origin?

  • What is $[\cos x,\sin x]$? What is $\overrightarrow{[\cos x,\sin x] p}$? I thought maybe you were taking a dot product, but then the result would be a scalar, so I don't understand why there's an arrow over the entire expression. – David K Sep 18 '15 at 17:58
  • Correct me if I am mistaken but is that not a valid way of saying $\vec{p}-[\cos{x},\sin{x}]$? As in the vector "pointing from" position $[\cos{x},\sin{x}]$ to position $\vec{p}$? – god of llamas Sep 18 '15 at 18:09
  • I've never seen it written that way, and it seems awkward to write and hard to read. I would just write $\overrightarrow p - [\cos x,\sin x]$, which is much clearer. – David K Sep 18 '15 at 18:13
  • OK, now that I know what this means I'm pretty sure the answer is yes, this can be solved by elementary functions. I don't have the time to do it at the moment, but maybe that encouragement will help. Also maybe my upvote on the question will help. – David K Sep 18 '15 at 18:33
  • @DavidK Thanks for the reassurance and upvote lol – god of llamas Sep 18 '15 at 18:45
  • I could be wrong about the "yes". All the more reason why the question should be of interest. – David K Sep 18 '15 at 19:16

1 Answers1

1

It is not perfectly clear what you ask for. In particular your last sentence is not clear to me. Yet, here is a comment that in the case $n=2$, it is possible to calculate the integral in terms of elementary functions. If that is easier or not for your computer, I don't know.

If we denote by $\vec{p}=[p_1,p_2]$, ($\|\vec{p}\|\neq 1$) and consider the case $n=2$, and I understood correctly that you want to calculate $$ \int_0^\tau\frac{1}{(\cos x-p_1)^2+(\sin x-p_2)^2}\,dx, $$ then I suggest that you let $u=\tan(x/2)$. You will then hopefully find a primitive like $$ \frac{2}{p_1^2+p_2^2-1}\arctan\biggl(\frac{(1+2p_1+p_1^2+p_2^2)\tan(x/2)-2p_2}{p_1^2+p_2^2-1}\biggr). $$ With $n=1$, the primitive will be more difficult, and I suspect there will be no way of expressing it in terms of elementary functions, but I'm not sure.

mickep
  • 19,962
  • I think $n=2$ simplifies a bit if you consider only $p = [p_1,0]$ at first, then generalize. For $n=1$ it looks like there's an elliptic integral involved, so not so simple after all. – David K Sep 18 '15 at 19:25
  • Thanks. I'll try out both methods in a short c++ program now ^_^ – god of llamas Sep 18 '15 at 19:30
  • @DavidK Sorry for being a bit of a maths noob, but I'm not sure where/what the $x$ in your derived expression comes from/represents (I noticed now because I was sequentially implementing it in c++ after getting the integral version to work). '~' – god of llamas Sep 18 '15 at 20:36