You'll find the Ultimate Weapon recipe in Twilight Town, specifically in the room where you played as Roxas, right before he transforms into Sora.