Atticus thinks that Jem killed Bob Ewell in the course of the struggle. He stops to consider for a moment how old Jem is since this might make a difference in the course of a legal investigation. This shows that Atticus would not expect any special privileges for his family, and that he would want Jem to be subjected to the same investigation that anyone else would go through. It's Sherriff Tate who realizes that Boo Radley has actually killed Ewell to save Jem and Scout. But Ewell does not want Boo subjected to the limelight, knowing how painful this would be for Boo. His official decree is that Bob Ewell has fallen on his own knife.
You can find a complete summary and analysis of this book on e-notes. Here is the link to Chapter 30: http://www.enotes.com/mockingbird/chapter-30-summary-analysis
It is obvious to Atticus and the sheriff Mr Heck Tate that Ewell was killed when struggling with Boo Radley or Jem, whether he 'fell on his own knife' or not. Most likely, it was Boo who killed Bob Ewell in defending Scout and Jem from his brutal attack. Scout had heard a scraping sound, evidently that of the knife blade glancing off the chicken wire that made up her "ham" outfit.
Ironically, it is Heck Tate who acknowledges that "Bob Ewell "meant business" whereas Atticus at first is in a state of denial over Ewell's intentions to really inflict harm upon his children:
"He was out of hims mind....I can't conceive of a man who'd-"...
It is also Heck Tate who decides on the "official" rendition of events to be written up in the report. Instead of investigating Jem or Boo, he decides to wrap up the case succinctly:
"Mr Finch," Mr Tate said stolidly, "Bob Ewell fell on his kife, He killed himself.
When Atticus protests, Mr Tate insists, saying he can "prove it." He then takes out a switch-blade and demonstrates to both Atticus and Dr. Reynolds how exactly Ewell fell on it, piercing himself between the ribs. Case closed. For the second time (only this time metaphorically speaking) Atticus Finch - the sharp-shootiing lawyer - learns to let dead dogs lie....
For Atticus finally relents to Mr Tate's rendition of the story since, after all, poetic justice has been done. Both Jem and Boo are spared the ordeal of an inquest, and Mr Ewell got what he deserved.
After Dr Reynolds' departure, Atticus doesn't forget to show his gratitude towards Boo. He goes by the Radley house close enough to be within earshot and tells him quietly, "Thank you for my children, Arthur," then walks away.
At first he believes Jem killed Bob, and then he gets worried because Jem would have to deal with legal issues and he did not want this to affect the kids. However, Mr. Tate closes the issue by saying that Bob Ewell fell on the knife, which he also demonstrates, and then closes the case. Therefore, neither Jem nor Boo has to deal with any legal issues.