I am wondering if any philosopher has considered the rationality of suicide and wrote in great detail about it.
Suicide is a theme, explicitly, for some philosophers. For others, it is implied by their other statements.
For example: if one is a Christian or Buddhist philosopher, then suicide is explicitly rejected in advance according to be doctrine, and may not need to be discussed in other philosophical works.
Alternatively, if one is a Hedonist, one is attempting to maximize pleasure and minimize pain. And, under these circumstances, suicide could be a rational act.
For example: Imagine that you are a prisoner of war who has been captured by a brutal enemy. The enemy knows that you are in possession of important, secret information which can be used against your country, and you know that they know this. You know that they will torture you to get the information, and then kill you. You have in your possession a hidden cyanide tablet, which will kill you painlessly and instantly.
If these facts are known, with an extremely high degree of certainty, to be the case, then suicide would appear to be a rational act for a Hedonist in these circumstances.
Where this case differs from that of the teenager in the article mentioned in the question is largely a matter of evaluation: the amount of pleasure expected in the future, the amount of pain expected, and the certainty of the estimates-- but the logic remains the same.
Generally speaking, suicide has been more explicitly treated in the sociological literature; Emile Durkheim's book on the subject is the canonical starting point.
I understand Albert Camus said that, Suicide was the only true philosophical question and he did put suicide as one of the responses to Absurdism.
That is true, but remember that Camus is not recommending suicide. For Camus, the fact that the universe is absurd means that there is no meaning to life which precedes our existence; in such a situation, one of the most important philosophical questions to grapple with, in fact, perhaps the only philosophical question, is whether to go on living. To continue to live (i.e., not not commit suicide) is a choice-- the question then becomes, what is that choice based upon? This constitutes the meaning of one's life.
Eventually I hope to get a sense of the logic that made the kid to commit suicide.
The logic is clear-- he felt that the pain he was enduring was too great to be offset by any possible future circumstances. Clearly, his evaluative skills were impaired, most likely be depression. But there's little point in psychoanalyzing at a distance.