Question: So the question asks: 

Tom and Jerry set up a meeting at a restaurant. Each one of them, independently of the other, arrives at some random time between 9:00 pm and 10:00 pm (that is, the arrival time is uniformly distributed between 9 and 10). Jerry is quite patient and waits for 10 minutes and then leaves, while Tom waits for 5 minutes and then leaves. What is the probability that they meet? Given that they met, what is the probability that Tom arrived first?

So so far I got: 

[![enter image description here](https://i.stack.imgur.com/ih2TV.png)](https://i.stack.imgur.com/ih2TV.png)

So the area between the blue lines is the possibility that Tom meets Jerry: 

So P(Tom and Jerry meet) = $\frac{60^2 - 0.5 \* 55^2- 0.5 \* 50^2}{60^2} = 0.232638889 $

And for the probability that Tom arrived first given they would meet, I think since the total area of possibility that they meet is 

$60^2 - 0.5 \* 55^2- 0.5 \* 50^2 = 837.5 $

So the probability that Tom arrived first would be : $\frac{0.5 \* 837.5 \* \frac{5}{10+5}}{837.5} = 0.166666666 $

But I really not sure about this answer. So does the first part look alright, and how can I get the probability that Tom arrived first?

Answer: 
The absolute value is irrelevant: the derivative of $f(x)=\log|x|$ is $1/x$ without having to do any particular division into cases. Indeed
$$
\log|x|=\frac{1}{2}\log(x^2)
$$
so the derivative is
$$
\frac{1}{2}\frac{1}{x^2}\cdot2x=\frac{1}{x}
$$
(You can also do by dividing $\log|x|$ into cases).

Thus you can express the derivative as
$$
-\frac{1}{\tan y}\cdot\frac{1}{\cos^2y}\cdot\left(-\frac{1}{2}\right)=
\frac{1}{2\sin y\cos y}=\frac{1}{\sin 2y}=\frac{1}{\cos x}=\sec x
$$
where I set $y=\frac{\pi}{4}-\frac{x}{2}$ for avoiding too complicated formulas.

---

In the direct way, you can do with the substitution $x=\frac{\pi}{2}-2t$, so you get
$$
\int\frac{1}{\cos x}\,dx=\int\frac{2}{\sin2t}\,dt=
\int\frac{\cos^2t+\sin^2t}{\sin t\cos t}\,dt=
\int\frac{\cos t}{\sin t}\,dt+\int\frac{\sin t}{\cos t}\,dt
$$
and finally you find
$$
\log|\sin t|-\log|\cos t|+c=\log|\tan t|+c
$$
HINT:

Let $y=\dfrac\pi4-\dfrac x2\implies x=\dfrac\pi2-2y$

$\sec x=\csc2y=\dfrac{\sec^2y}{2\tan y}$

Set $\tan y=u$