So Long, Sophocles! (Japanese: さよならマーマネ！Farewell, Mamane!) is the 26th episode of the Sun & Moon series, and the 965th episode of the Pokémon anime. It first aired in Japan on May 11, 2017 and in the United States on August 5, 2017.
When Sophocles finds out that his family has to move, he keeps it to himself because he doesn’t want his friends to be sad—but eventually, he has to tell them. Kiawe and Lana take Sophocles to their favorite places in Alola, Mallow plans a goodbye dinner, and Ash arrives with a special gift: a Charjabug for Sophocles to catch!
In the end, Sophocles doesn’t have to leave after all—his family is just moving to a nearby rental for a week while their house is repaired. He’s reluctant to share the good news after his friends made such a fuss, but everyone is delighted that they can stay together!
Sophocles is working in his personal laboratory, finishing up his newest program, which allows him to change the facial expressions on a picture as he wishes. Feeling hungry, Sophocles decides to return to the house for a snack, but overhears his parents discussing about packing. Shocked, Sophocles asks his mother for details, only to be reminded by her that she told him that they were moving, but Sophocles apparently did not hear it. Sophocles's father confirms this, remarking that they're moving "farther than he'd like". Believing this to mean that his family is moving very far away, Sophocles is horrified by the news and runs back to his laboratory. While he initially considers living alone instead, he realizes that he cannot take care of himself and frets.
That night, Sophocles is too worried to fall asleep, and when his parents knock on his door, he pretends to have fallen asleep. His mother tells him that he has a week to pack before saying goodnight. As he hides himself under the blanket, he becomes scared of the dark but Togedemaru makes things brighter, calming Sophocles down. He reiterates that he does not want to move. Togedemaru does not understand what he means, so Sophocles explains that it mean saying goodbye to Pikachu. As Togedemaru still fails to understand, Sophocles shows it an animation on his computer, Togedemaru finally understand and they both start to cry.
The next day, Sophocles and Togedemaru are walking to school. Sophocles wonders on how he is going to tell everybody when Ash runs alongside and greets him. Ash notices he looks down and asks him what was wrong but Sophocles says he is alright. Pikachu waves to Togedemaru but it starts to cry. In class, Professor Kukui is telling his students about the BatteryAbility but Sophocles is distracted by the news he is moving and is not paying attention. He did not hear Professor Kukui's question, and Kukui comments that it is unusual for Sophocles to be distracted when discussing about Electric-types. Sophocles admits this, which makes everyone laugh. Sophocles starts to wonder whether Professor Kukui does not know he is leaving or if he does know but chooses to act normally. Sophocles decides to keep it a secret from everyone.
Later during P.E. class, everyone is outside on the track for a baton relay with the Pokémon running first and then the Trainers. As the Pokémon get ready to run, Togedemaru is overcome with tears as it watches Pikachu and rolls over to Pikachu and cuddles it with its back. Lana notices Togedemaru is crying as Professor Kukui asks Sophocles if something is wrong. Sophocles denies and says that sometimes Togedemaru likes Pikachu so much that Togedemaru cannot control itself. As school ends, Sophocles gives everyone a map, having circled all the sweet shops that he thinks are the best. Mallow wonders why he is giving them the map but he makes up an excuse saying he does not feel it is right to keep it to himself, and that these needs to be shared. As Lana becomes suspicious, he decides to head back home.
Sophocles is walking home and decides it is better to leave the others not knowing. He realizes that his classmates are blocking his way, having guessed that something has happened. Sophocles denies it but upon being comfort by them, he tells them the truth. After knowing it, Ash comes to the decision that they should all act as nothing has changed. Mallow decides that on his last day, they can have a farewell party at her restaurant. Sophocles agrees that it is a good idea. Kiawe asks Sophocles if he is busy, which he replies no. Kiawe takes Sophocles and Togedemaru for a trip to the Wela Volcano on his Charizard. Kiawe reveals his secret spot which is a hot spring where the volcano turns the water a different color. Sophocles finds it pretty and wants to analyse the chemical composition. As Kiawe talks, Sophocles interrupts him and thanks him for it.
Later in the evening, Kiawe drops Sophocles off outside his house and bids farewell. Inside his lab, Sophocles wants to give Kiawe a present and wonders what to give him when his parents knock on the door before coming in. His mother sees that he has not packed yet, and his father thinks they should leave it as it is even though they would have to commute back from the new place. Sophocles is concerned about the distance but his father explains he had hoped to rent the house next door but had to rent three houses away from them which leaves Sophocles shocked. His mother tries to cheer him up as it will only be for a week whilst the roof is repaired. The next day at school, Sophocles imagines that all of his friends are angry at him for lying as he is not moving when they come over to cheer him up. Sophocles is worried about telling them the truth as Mallow reminds him how they all agreed to remain upbeat. Sophocles decides he has to tell them the truth but before he can, Lana asks him to follow her. They head to Lana's house where she asks her to hop on her Lapras.
As the sun begins to set, Lana explains that this is a special place, and that something special may occur. After a while, Lana spots a Wailord breaching out of the water. Sophocles is amazed at the sight as Lana asks him to remember Alola's ocean, which makes Sophocles upset. He denies that something is wrong when Lana asks him. At Professor Kukui's house, Ash is wondering what to get Sophocles as a goodbye present and is looking at his T-Shirts. Rotom gives Ash a suggestion that he should find him an Electric-type Pokémon.
The next day, Sophocles decides to confess to them, however they informs him that they should get ready for the party. Ash and his Pokémon searches for a Pokémon to give to Sophocles in the forest. At the restaurant, Mallow notices Sophocles and welcomes him in. As he is about to spill out the truth, she pulls him in. As he continues to talk, Mimo and the rest arrive at the restaurant. In the forest, Rockruff informs Ash that it found the Pokémon. Rockruff, Litten and Pikachu start digging and reveals the Pokémon. Ash tries to pull it out of the ground but is shocked by the Pokémon's Electric-type move. When Lana comments on Ash being late, Mallow decides to start the party without him. As Sophocles eats, his classmates wish him the best of luck. Lillie starts to cry after making her wishes. He is about to confess when Ash enters the restaurant. Ash reveals his present to Sophocles, a Charjabug. Sophocles thanks Ash and battles it to capture it. After a few attacks, he manages to capture it. When his classmates congratulate him and wish him luck, Sophocles starts crying and tells them he is only moving to another place for a week. Ash says that he is relief that Sophocles is not leaving them. Sophocles explains to Togedemaru that he misunderstood his parents' words and that it will not be separated from Pikachu. Togedemaru is happy and begins shocking everyone in joy, while Rotom Pokédex snaps photographs of them.